|
|
|
|
@@ -1,102 +0,0 @@
|
|
|
|
|
[gd_scene format=3 uid="uid://b18rv6o4duide"]
|
|
|
|
|
|
|
|
|
|
[ext_resource type="Texture2D" uid="uid://bgw8xgbwc2flx" path="res://godot_state_charts_examples/history_states/white_rectangle.svg" id="1_3v23e"]
|
|
|
|
|
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_fgw1q"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_pqmip"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://bad613wfktgah" path="res://godot_state_charts_examples/history_states/history_demo.gd" id="2_vphtk"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="3_nsw2j"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://b4dwolbvt8our" path="res://addons/godot_state_charts/history_state.gd" id="4_0qaqv"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_lh5sp"]
|
|
|
|
|
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_xvm5g"]
|
|
|
|
|
[ext_resource type="Theme" uid="uid://s2bj74tt0y7f" path="res://godot_state_charts_examples/new_theme.tres" id="8_najew"]
|
|
|
|
|
|
|
|
|
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kl3ga"]
|
|
|
|
|
size = Vector2(34.243, 33.536)
|
|
|
|
|
|
|
|
|
|
[node name="Node" type="Node" unique_id=862962838]
|
|
|
|
|
script = ExtResource("2_vphtk")
|
|
|
|
|
|
|
|
|
|
[node name="StateChartDebugger" parent="." unique_id=805175203 instance=ExtResource("2_fgw1q")]
|
|
|
|
|
offset_left = 280.0
|
|
|
|
|
offset_top = 9.0
|
|
|
|
|
offset_right = -12.0
|
|
|
|
|
offset_bottom = -190.0
|
|
|
|
|
theme = ExtResource("8_najew")
|
|
|
|
|
initial_node_to_watch = NodePath("../StateChart")
|
|
|
|
|
|
|
|
|
|
[node name="Node2D" type="Sprite2D" parent="." unique_id=974890824]
|
|
|
|
|
position = Vector2(145, 206)
|
|
|
|
|
scale = Vector2(6.6875, 3.90625)
|
|
|
|
|
texture = ExtResource("1_3v23e")
|
|
|
|
|
|
|
|
|
|
[node name="Area2D" type="Area2D" parent="Node2D" unique_id=1643259898]
|
|
|
|
|
|
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Node2D/Area2D" unique_id=1663362984]
|
|
|
|
|
position = Vector2(0.0747795, 3.8147e-06)
|
|
|
|
|
shape = SubResource("RectangleShape2D_kl3ga")
|
|
|
|
|
|
|
|
|
|
[node name="StateChart" type="Node" parent="." unique_id=1329389698]
|
|
|
|
|
script = ExtResource("2_pqmip")
|
|
|
|
|
track_in_editor = true
|
|
|
|
|
|
|
|
|
|
[node name="Root" type="Node" parent="StateChart" unique_id=2011728267]
|
|
|
|
|
script = ExtResource("3_nsw2j")
|
|
|
|
|
initial_state = NodePath("Red Or Blue")
|
|
|
|
|
|
|
|
|
|
[node name="Red Or Blue" type="Node" parent="StateChart/Root" unique_id=1885920353]
|
|
|
|
|
script = ExtResource("3_nsw2j")
|
|
|
|
|
initial_state = NodePath("Red")
|
|
|
|
|
|
|
|
|
|
[node name="Resume" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=1200215160]
|
|
|
|
|
script = ExtResource("4_0qaqv")
|
|
|
|
|
default_state = NodePath("../Red")
|
|
|
|
|
|
|
|
|
|
[node name="Red" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=551636337]
|
|
|
|
|
script = ExtResource("5_lh5sp")
|
|
|
|
|
|
|
|
|
|
[node name="To Blue" type="Node" parent="StateChart/Root/Red Or Blue/Red" unique_id=2106677099]
|
|
|
|
|
script = ExtResource("6_xvm5g")
|
|
|
|
|
to = NodePath("../../Blue")
|
|
|
|
|
delay_in_seconds = "3"
|
|
|
|
|
|
|
|
|
|
[node name="Blue" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=1974095970]
|
|
|
|
|
script = ExtResource("5_lh5sp")
|
|
|
|
|
|
|
|
|
|
[node name="To Red" type="Node" parent="StateChart/Root/Red Or Blue/Blue" unique_id=1727482107]
|
|
|
|
|
script = ExtResource("6_xvm5g")
|
|
|
|
|
to = NodePath("../../Red")
|
|
|
|
|
delay_in_seconds = "3"
|
|
|
|
|
|
|
|
|
|
[node name="On Clicked To White" type="Node" parent="StateChart/Root/Red Or Blue" unique_id=256818810]
|
|
|
|
|
script = ExtResource("6_xvm5g")
|
|
|
|
|
to = NodePath("../../White")
|
|
|
|
|
event = &"clicked"
|
|
|
|
|
delay_in_seconds = "0.0"
|
|
|
|
|
|
|
|
|
|
[node name="White" type="Node" parent="StateChart/Root" unique_id=2050088950]
|
|
|
|
|
script = ExtResource("5_lh5sp")
|
|
|
|
|
|
|
|
|
|
[node name="Resume" type="Node" parent="StateChart/Root/White" unique_id=700482805]
|
|
|
|
|
script = ExtResource("6_xvm5g")
|
|
|
|
|
to = NodePath("../../Red Or Blue/Resume")
|
|
|
|
|
delay_in_seconds = "1"
|
|
|
|
|
|
|
|
|
|
[node name="Label" type="RichTextLabel" parent="." unique_id=700438554]
|
|
|
|
|
offset_left = 26.0
|
|
|
|
|
offset_top = 318.0
|
|
|
|
|
offset_right = 376.0
|
|
|
|
|
offset_bottom = 416.0
|
|
|
|
|
mouse_filter = 2
|
|
|
|
|
bbcode_enabled = true
|
|
|
|
|
text = "[font_size=10]
|
|
|
|
|
[ul]
|
|
|
|
|
The rectangle will switch from red to blue every 3 seconds.
|
|
|
|
|
When you click the rectangle it will temporarily turn white and then return to whatever color it was previously by transitioning to the \"Resume\" state. The timer will also be properly restored, so the previously active color will remain active for the rest of the 5 seconds.
|
|
|
|
|
[/ul]
|
|
|
|
|
[/font_size]"
|
|
|
|
|
fit_content = true
|
|
|
|
|
|
|
|
|
|
[connection signal="input_event" from="Node2D/Area2D" to="." method="_on_area_2d_input_event"]
|
|
|
|
|
[connection signal="state_entered" from="StateChart/Root/Red Or Blue/Red" to="Node2D" method="set_modulate" binds= [Color(1, 0.231373, 0.172549, 1)]]
|
|
|
|
|
[connection signal="state_entered" from="StateChart/Root/Red Or Blue/Blue" to="Node2D" method="set_modulate" binds= [Color(0.286275, 0.501961, 1, 1)]]
|
|
|
|
|
[connection signal="state_entered" from="StateChart/Root/White" to="Node2D" method="set_modulate" binds= [Color(1, 1, 1, 1)]]
|