├── addons
└── godot_state_charts
│ ├── LICENSE
│ ├── all_of_guard.gd
│ ├── all_of_guard.gd.uid
│ ├── all_of_guard.svg
│ ├── all_of_guard.svg.import
│ ├── animation_player_state.gd
│ ├── animation_player_state.gd.uid
│ ├── animation_player_state.svg
│ ├── animation_player_state.svg.import
│ ├── animation_tree_state.gd
│ ├── animation_tree_state.gd.uid
│ ├── animation_tree_state.svg
│ ├── animation_tree_state.svg.import
│ ├── any_of_guard.gd
│ ├── any_of_guard.gd.uid
│ ├── any_of_guard.svg
│ ├── any_of_guard.svg.import
│ ├── atomic_state.gd
│ ├── atomic_state.gd.uid
│ ├── atomic_state.svg
│ ├── atomic_state.svg.import
│ ├── compound_state.gd
│ ├── compound_state.gd.uid
│ ├── compound_state.svg
│ ├── compound_state.svg.import
│ ├── csharp
│ ├── CompoundState.cs
│ ├── CompoundState.cs.uid
│ ├── NodeWrapper.cs
│ ├── NodeWrapper.cs.uid
│ ├── StateChart.cs
│ ├── StateChart.cs.uid
│ ├── StateChartDebugger.cs
│ ├── StateChartDebugger.cs.uid
│ ├── StateChartState.cs
│ ├── StateChartState.cs.uid
│ ├── Transition.cs
│ └── Transition.cs.uid
│ ├── debug_util.gd
│ ├── debug_util.gd.uid
│ ├── expression_guard.gd
│ ├── expression_guard.gd.uid
│ ├── expression_guard.svg
│ ├── expression_guard.svg.import
│ ├── expression_util.gd
│ ├── expression_util.gd.uid
│ ├── godot_state_charts.gd
│ ├── godot_state_charts.gd.uid
│ ├── guard.gd
│ ├── guard.gd.uid
│ ├── guard.svg
│ ├── guard.svg.import
│ ├── history_state.gd
│ ├── history_state.gd.uid
│ ├── history_state.svg
│ ├── history_state.svg.import
│ ├── not_guard.gd
│ ├── not_guard.gd.uid
│ ├── not_guard.svg
│ ├── not_guard.svg.import
│ ├── parallel_state.gd
│ ├── parallel_state.gd.uid
│ ├── parallel_state.svg
│ ├── parallel_state.svg.import
│ ├── plugin.cfg
│ ├── saved_state.gd
│ ├── saved_state.gd.uid
│ ├── state_chart.gd
│ ├── state_chart.gd.uid
│ ├── state_chart.svg
│ ├── state_chart.svg.import
│ ├── state_chart_state.gd
│ ├── state_chart_state.gd.uid
│ ├── state_is_active_guard.gd
│ ├── state_is_active_guard.gd.uid
│ ├── state_is_active_guard.svg
│ ├── state_is_active_guard.svg.import
│ ├── toggle_sidebar.svg
│ ├── toggle_sidebar.svg.import
│ ├── transition.gd
│ ├── transition.gd.uid
│ ├── transition.svg
│ ├── transition.svg.import
│ └── utilities
│ ├── debugger_history.gd
│ ├── debugger_history.gd.uid
│ ├── editor_debugger
│ ├── editor_debugger.gd
│ ├── editor_debugger.gd.uid
│ ├── editor_debugger.tscn
│ ├── editor_debugger_message.gd
│ ├── editor_debugger_message.gd.uid
│ ├── editor_debugger_plugin.gd
│ ├── editor_debugger_plugin.gd.uid
│ ├── editor_debugger_remote.gd
│ ├── editor_debugger_remote.gd.uid
│ ├── editor_debugger_settings_propagator.gd
│ ├── editor_debugger_settings_propagator.gd.uid
│ ├── editor_debugger_state_info.gd
│ └── editor_debugger_state_info.gd.uid
│ ├── editor_sidebar.gd
│ ├── editor_sidebar.gd.uid
│ ├── editor_sidebar.tscn
│ ├── event_editor
│ ├── event_editor.gd
│ ├── event_editor.gd.uid
│ ├── event_inspector_plugin.gd
│ └── event_inspector_plugin.gd.uid
│ ├── event_refactor
│ ├── event_refactor.gd
│ ├── event_refactor.gd.uid
│ └── event_refactor.tscn
│ ├── ring_buffer.gd
│ ├── ring_buffer.gd.uid
│ ├── state_chart_debugger.gd
│ ├── state_chart_debugger.gd.uid
│ ├── state_chart_debugger.svg
│ ├── state_chart_debugger.svg.import
│ ├── state_chart_debugger.tscn
│ ├── state_chart_util.gd
│ └── state_chart_util.gd.uid
└── godot_state_charts_examples
├── ant_hill
├── ant
│ ├── ant.gd
│ ├── ant.gd.uid
│ ├── ant.gdshader
│ ├── ant.gdshader.uid
│ ├── ant.tscn
│ ├── walk.png
│ └── walk.png.import
├── ant_hill_demo.gd
├── ant_hill_demo.gd.uid
├── ant_hill_demo.tscn
├── banana
│ ├── banana.svg
│ ├── banana.svg.import
│ └── banana.tscn
├── marker
│ ├── circle_white.svg
│ ├── circle_white.svg.import
│ ├── marker.gd
│ ├── marker.gd.uid
│ └── marker.tscn
├── nest
│ ├── nest.svg
│ ├── nest.svg.import
│ └── nest.tscn
├── pause_controller.gd
└── pause_controller.gd.uid
├── automatic_transitions
├── automatic_transitions_demo.tscn
├── stamina_bar.gd
├── stamina_bar.gd.uid
├── the_frog.gd
└── the_frog.gd.uid
├── cooldown
├── LICENSE.md
├── cooldown_demo.tscn
├── icons
│ ├── cooldown_overlay.png
│ ├── cooldown_overlay.png.import
│ ├── enchant-red-3.png
│ ├── enchant-red-3.png.import
│ ├── fireball-eerie-2.png
│ ├── fireball-eerie-2.png.import
│ ├── heal-jade-2.png
│ └── heal-jade-2.png.import
└── skill_button
│ ├── skill_button.gd
│ ├── skill_button.gd.uid
│ └── skill_button.tscn
├── csharp
├── CSharpExample.cs
├── CSharpExample.cs.uid
├── README.txt
├── StateChartExt.cs
├── StateChartExt.cs.uid
└── csharp_example.tscn
├── history_states
├── history_demo.gd
├── history_demo.gd.uid
├── history_demo.tscn
├── white_rectangle.svg
└── white_rectangle.svg.import
├── new_theme.tres
├── order_of_events
└── order_of_events.tscn
├── performance_test
├── hundred_state_charts.tscn
├── state_chart.tscn
├── state_chart_receiver.gd
├── state_chart_receiver.gd.uid
├── ten_state_charts.tscn
└── thousand_state_charts.tscn
├── platformer
├── breaking_box
│ ├── break.png
│ ├── break.png.import
│ ├── breaking_box.gd
│ ├── breaking_box.gd.uid
│ ├── breaking_box.tscn
│ ├── hit.png
│ ├── hit.png.import
│ ├── idle.png
│ └── idle.png.import
├── checkpoint
│ ├── checkpoint.gd
│ ├── checkpoint.gd.uid
│ ├── checkpoint.tscn
│ ├── checkpoint_flag_out.png
│ ├── checkpoint_flag_out.png.import
│ ├── checkpoint_idle.png
│ ├── checkpoint_idle.png.import
│ ├── checkpoint_no_flag.png
│ └── checkpoint_no_flag.png.import
├── fireworks_box
│ ├── box.png
│ ├── box.png.import
│ ├── fireworks_box.gd
│ ├── fireworks_box.gd.uid
│ └── fireworks_box.tscn
├── ninja_frog
│ ├── full.png
│ ├── full.png.import
│ ├── ninja_frog.gd
│ ├── ninja_frog.gd.uid
│ └── ninja_frog.tscn
├── platformer_demo.tscn
└── terrain
│ ├── green.png
│ ├── green.png.import
│ ├── terrain_tiles.png
│ ├── terrain_tiles.png.import
│ └── terrain_tiles.tres
├── random_transitions
├── random_transitions.tscn
└── wandering_frog
│ ├── wandering_frog.gd
│ ├── wandering_frog.gd.uid
│ └── wandering_frog.tscn
└── stepping
├── stepping.gd
├── stepping.gd.uid
└── stepping.tscn
/addons/godot_state_charts/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Jan Thomä
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/all_of_guard.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | @icon("all_of_guard.svg")
3 |
4 | ## A composite guard that is satisfied when all of its guards are satisfied.
5 | class_name AllOfGuard
6 | extends Guard
7 |
8 | ## The guards that need to be satisified. When empty, returns true.
9 | @export var guards:Array[Guard] = []
10 |
11 | func is_satisfied(context_transition:Transition, context_state:StateChartState) -> bool:
12 | for guard in guards:
13 | if not guard.is_satisfied(context_transition, context_state):
14 | return false
15 | return true
16 |
17 |
18 | func get_supported_trigger_types() -> int:
19 | var supported_trigger_types:int = StateChart.TriggerType.NONE
20 | for guard in guards:
21 | supported_trigger_types |= guard.get_supported_trigger_types()
22 | return supported_trigger_types
23 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/all_of_guard.gd.uid:
--------------------------------------------------------------------------------
1 | uid://bxprlw40wl0c3
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/all_of_guard.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/all_of_guard.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://ux4ia8xhhjrx"
6 | path="res://.godot/imported/all_of_guard.svg-49642db22a4a20844b2d39e67c930c8b.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/all_of_guard.svg"
15 | dest_files=["res://.godot/imported/all_of_guard.svg-49642db22a4a20844b2d39e67c930c8b.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_player_state.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | @icon("animation_player_state.svg")
3 | class_name AnimationPlayerState
4 | extends AtomicState
5 |
6 | ## Animation player that this state will use.
7 | @export_node_path("AnimationPlayer") var animation_player: NodePath:
8 | set(value):
9 | animation_player = value
10 | update_configuration_warnings()
11 |
12 | ## The name of the animation that should be played when this state is entered.
13 | ## When this is empty, the name of this state will be used.
14 | @export var animation_name: StringName = ""
15 |
16 | ## A custom blend time for the animation. The default value of -1.0 will use the
17 | ## default blend time of the animation player.
18 | @export var custom_blend: float = -1.0
19 |
20 | ## A custom speed for the animation. Use negative values to play the animation
21 | ## backwards.
22 | @export var custom_speed: float = 1.0
23 |
24 | ## Whether the animation should be played from the end.
25 | @export var from_end: bool = false
26 |
27 | var _animation_player: AnimationPlayer
28 |
29 | func _ready():
30 | if Engine.is_editor_hint():
31 | return
32 |
33 | super._ready()
34 | _animation_player = get_node_or_null(animation_player)
35 |
36 | if not is_instance_valid(_animation_player):
37 | push_error("The animation player is invalid. This node will not work.")
38 |
39 | func _state_enter(transition_target:StateChartState):
40 | super._state_enter(transition_target)
41 |
42 | if not is_instance_valid(_animation_player):
43 | return
44 |
45 | var target_animation = animation_name
46 | if target_animation == "":
47 | target_animation = get_name()
48 |
49 | if _animation_player.current_animation == target_animation and _animation_player.is_playing():
50 | return
51 |
52 | _animation_player.play(target_animation, custom_blend, custom_speed, from_end)
53 |
54 | func _get_configuration_warnings():
55 | var warnings = super._get_configuration_warnings()
56 | warnings.append("This node is deprecated and will be removed in a future version.")
57 |
58 | if animation_player.is_empty():
59 | warnings.append("No animation player is set.")
60 | elif get_node_or_null(animation_player) == null:
61 | warnings.append("The animation player path is invalid.")
62 |
63 | return warnings
64 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_player_state.gd.uid:
--------------------------------------------------------------------------------
1 | uid://b5vawfqxn7cyf
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_player_state.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_player_state.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://b3m20gsesp4i0"
6 | path="res://.godot/imported/animation_player_state.svg-1acd03c414690dd7446458c5293935cb.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/animation_player_state.svg"
15 | dest_files=["res://.godot/imported/animation_player_state.svg-1acd03c414690dd7446458c5293935cb.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_tree_state.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | @icon("animation_tree_state.svg")
3 | class_name AnimationTreeState
4 | extends AtomicState
5 |
6 |
7 | ## Animation tree that this state will use.
8 | @export_node_path("AnimationTree") var animation_tree:NodePath:
9 | set(value):
10 | animation_tree = value
11 | update_configuration_warnings()
12 |
13 | ## The name of the state that should be activated in the animation tree
14 | ## when this state is entered. If this is empty, the name of this state
15 | ## will be used.
16 | @export var state_name:StringName = ""
17 |
18 |
19 | var _animation_tree_state_machine:AnimationNodeStateMachinePlayback
20 |
21 | func _ready():
22 | if Engine.is_editor_hint():
23 | return
24 |
25 | super._ready()
26 |
27 | _animation_tree_state_machine = null
28 | var the_tree = get_node_or_null(animation_tree)
29 |
30 | if is_instance_valid(the_tree):
31 | var state_machine = the_tree.get("parameters/playback")
32 | if state_machine is AnimationNodeStateMachinePlayback:
33 | _animation_tree_state_machine = state_machine
34 | else:
35 | push_error("The animation tree does not have a state machine as root node. This node will not work.")
36 | else:
37 | push_error("The animation tree is invalid. This node will not work.")
38 |
39 |
40 | func _state_enter(transition_target:StateChartState):
41 | super._state_enter(transition_target)
42 |
43 | if not is_instance_valid(_animation_tree_state_machine):
44 | return
45 |
46 | var target_state = state_name
47 | if target_state == "":
48 | target_state = get_name()
49 |
50 | # mirror this state to the animation tree
51 | _animation_tree_state_machine.travel(target_state)
52 |
53 |
54 | func _get_configuration_warnings():
55 | var warnings = super._get_configuration_warnings()
56 | warnings.append("This node is deprecated and will be removed in a future version.")
57 |
58 | if animation_tree.is_empty():
59 | warnings.append("No animation tree is set.")
60 | elif get_node_or_null(animation_tree) == null:
61 | warnings.append("The animation tree path is invalid.")
62 |
63 | return warnings
64 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_tree_state.gd.uid:
--------------------------------------------------------------------------------
1 | uid://488xerv8d0xh
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_tree_state.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/animation_tree_state.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://3wqyduuj0fq"
6 | path="res://.godot/imported/animation_tree_state.svg-b99077fc178cfa1e23b2c854c7735c4a.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/animation_tree_state.svg"
15 | dest_files=["res://.godot/imported/animation_tree_state.svg-b99077fc178cfa1e23b2c854c7735c4a.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/any_of_guard.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | @icon("any_of_guard.svg")
3 |
4 | ## A composite guard, that is satisfied if any of the guards are satisfied.
5 | class_name AnyOfGuard
6 | extends Guard
7 |
8 | ## The guards of which at least one must be satisfied. If empty, this guard is not satisfied.
9 | @export var guards: Array[Guard] = []
10 |
11 | func is_satisfied(context_transition:Transition, context_state:StateChartState) -> bool:
12 | for guard in guards:
13 | if guard.is_satisfied(context_transition, context_state):
14 | return true
15 | return false
16 |
17 | func get_supported_trigger_types() -> int:
18 | var supported_trigger_types:int = StateChart.TriggerType.NONE
19 | for guard in guards:
20 | supported_trigger_types |= guard.get_supported_trigger_types()
21 | return supported_trigger_types
22 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/any_of_guard.gd.uid:
--------------------------------------------------------------------------------
1 | uid://duv2yyvlunsi8
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/any_of_guard.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/any_of_guard.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://dbf5ogymlonu4"
6 | path="res://.godot/imported/any_of_guard.svg-3b1aa026a997dbfebde2cc5993b5c820.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/any_of_guard.svg"
15 | dest_files=["res://.godot/imported/any_of_guard.svg-3b1aa026a997dbfebde2cc5993b5c820.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/atomic_state.gd:
--------------------------------------------------------------------------------
1 | @tool
2 | @icon("atomic_state.svg")
3 | ## This is a state that has no sub-states.
4 | class_name AtomicState
5 | extends StateChartState
6 |
7 | func _handle_transition(transition:Transition, source:StateChartState):
8 | # resolve the target state
9 | var target = transition.resolve_target()
10 | if not target is StateChartState:
11 | push_error("The target state '" + str(transition.to) + "' of the transition from '" + source.name + "' is not a state.")
12 | return
13 | # atomic states cannot transition, so we need to ask the parent
14 | # ask the parent
15 | get_parent()._handle_transition(transition, source)
16 |
17 |
18 | func _get_configuration_warnings() -> PackedStringArray :
19 | var warnings = super._get_configuration_warnings()
20 | # check if we have any child nodes which are not transitions
21 | for child in get_children():
22 | if child is StateChartState:
23 | warnings.append("Atomic states cannot have child states. These will be ignored.")
24 | break
25 | return warnings
26 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/atomic_state.gd.uid:
--------------------------------------------------------------------------------
1 | uid://cytafq8i1y8qm
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/atomic_state.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/atomic_state.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://c4ojtah20jtxc"
6 | path="res://.godot/imported/atomic_state.svg-5ab16e5747cef5b5980c4bf84ef9b1af.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/atomic_state.svg"
15 | dest_files=["res://.godot/imported/atomic_state.svg-5ab16e5747cef5b5980c4bf84ef9b1af.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/compound_state.gd.uid:
--------------------------------------------------------------------------------
1 | uid://jk2jm1g6q853
2 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/compound_state.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/compound_state.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="CompressedTexture2D"
5 | uid="uid://bbudjoa3ds4qj"
6 | path="res://.godot/imported/compound_state.svg-84780d78ec1f15e1cbb9d20f4df031a7.ctex"
7 | metadata={
8 | "has_editor_variant": true,
9 | "vram_texture": false
10 | }
11 |
12 | [deps]
13 |
14 | source_file="res://addons/godot_state_charts/compound_state.svg"
15 | dest_files=["res://.godot/imported/compound_state.svg-84780d78ec1f15e1cbb9d20f4df031a7.ctex"]
16 |
17 | [params]
18 |
19 | compress/mode=0
20 | compress/high_quality=false
21 | compress/lossy_quality=0.7
22 | compress/hdr_compression=1
23 | compress/normal_map=0
24 | compress/channel_pack=0
25 | mipmaps/generate=false
26 | mipmaps/limit=-1
27 | roughness/mode=0
28 | roughness/src_normal=""
29 | process/fix_alpha_border=true
30 | process/premult_alpha=false
31 | process/normal_map_invert_y=false
32 | process/hdr_as_srgb=false
33 | process/hdr_clamp_exposure=false
34 | process/size_limit=0
35 | detect_3d/compress_to=1
36 | svg/scale=1.0
37 | editor/scale_with_editor_scale=true
38 | editor/convert_colors_with_editor_theme=false
39 |
--------------------------------------------------------------------------------
/addons/godot_state_charts/csharp/CompoundState.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | // ReSharper disable once CheckNamespace
4 | namespace GodotStateCharts
5 | {
6 | using System;
7 | using Godot;
8 |
9 | ///
10 | /// Wrapper around the compound state node.
11 | ///
12 | public class CompoundState : StateChartState
13 | {
14 | ///
15 | /// Called when a child state is entered.
16 | ///
17 | public event Action ChildStateEntered
18 | {
19 | add => Wrapped.Connect(SignalName.ChildStateEntered, Callable.From(value));
20 | remove => Wrapped.Disconnect(SignalName.ChildStateEntered, Callable.From(value));
21 | }
22 |
23 | ///
24 | /// Called when a child state is exited.
25 | ///
26 | public event Action ChildStateExited
27 | {
28 | add => Wrapped.Connect(SignalName.ChildStateExited, Callable.From(value));
29 | remove => Wrapped.Disconnect(SignalName.ChildStateExited, Callable.From(value));
30 | }
31 |
32 | private CompoundState(Node wrapped) : base(wrapped)
33 | {
34 | }
35 |
36 | ///
37 | /// Creates a wrapper object around the given node and verifies that the node
38 | /// is actually a compound state. The wrapper object can then be used to interact
39 | /// with the compound state chart from C#.
40 | ///
41 | /// the node that is the state
42 | /// a State wrapper.
43 | /// ArgumentException if the node is not a state.
44 | public new static CompoundState Of(Node state)
45 | {
46 | if (state.GetScript().As