move level state under level director scene
This commit is contained in:
parent
bcc939df1c
commit
083a935833
2 changed files with 10 additions and 4 deletions
|
|
@ -11,8 +11,8 @@ var level: Level
|
|||
|
||||
func _ready() -> void:
|
||||
await owner.ready
|
||||
level = owner as Level
|
||||
assert(level != null, "The LevelState state type must be used only in the level scene. It needs the owner to be a Level node.")
|
||||
level = owner.owner as Level # ugly i know. im so sorry im so fucking sorry TODO: SAFER IMPLEMENTATION
|
||||
assert(level != null, "The LevelState state type must be used only in the level scene. It needs the owner's parent to be a Level node.")
|
||||
|
||||
|
||||
func _enter(_previous_state_path: String, _data: Dictionary = {}) -> void:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://4eo7g5abxolw"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://4eo7g5abxolw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bio2cjqps6kg1" path="res://scenes/level_director/level_director.gd" id="1_4q8ux"]
|
||||
[ext_resource type="Script" uid="uid://dikxx4j1auywf" path="res://scenes/levels/states/level_starting.gd" id="2_ywjt3"]
|
||||
|
||||
[node name="LevelDirector" type="Node"]
|
||||
[node name="LevelDirector" type="Node" node_paths=PackedStringArray("initial_state")]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_4q8ux")
|
||||
initial_state = NodePath("Starting")
|
||||
metadata/_custom_type_script = "uid://dqjaxgmyxq3rx"
|
||||
|
||||
[node name="Starting" type="Node" parent="."]
|
||||
script = ExtResource("2_ywjt3")
|
||||
metadata/_custom_type_script = "uid://dioh6egp2x760"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue