EditorLinkedElevator.tscn 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. [gd_scene load_steps=8 format=3 uid="uid://bhqyp8mia3mo3"]
  2. [ext_resource type="Script" uid="uid://duxduhxe8vqdo" path="res://Scripts/Classes/Entities/Objects/EditorLinkedElevator.gd" id="1_0yjq3"]
  3. [ext_resource type="Texture2D" uid="uid://dt0qtxu2l646n" path="res://Assets/Sprites/Tilesets/Terrain/Overworld.png" id="2_lcqnt"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_5tm0t"]
  5. [ext_resource type="JSON" path="res://Assets/Sprites/Tilesets/Terrain/TerrainTiles.json" id="4_ohybb"]
  6. [ext_resource type="PackedScene" uid="uid://6rp3wgax4i51" path="res://Scenes/Prefabs/Entities/Objects/RopeElevatorPlatform.tscn" id="5_5qwbh"]
  7. [ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="6_lcqnt"]
  8. [sub_resource type="GDScript" id="GDScript_0yjq3"]
  9. script/source = "extends Node
  10. func _process(_delta: float) -> void:
  11. if LevelEditor.playing_level == false:
  12. update()
  13. func update() -> void:
  14. $\"../CornerR\".position.x = (16 * owner.width) + 48
  15. $\"../Middle\".size.x = (owner.width * 16) + 32
  16. %RPlatform.position.y = (16 * owner.right_height) + 16
  17. %LPlatform.position.y = (16 * owner.left_height) + 16
  18. %LPlatform.rope_top = owner.global_position.y
  19. %RPlatform.rope_top = owner.global_position.y
  20. %RPlatform._process(-1)
  21. %LPlatform._process(-1)
  22. "
  23. [node name="EditorLinkedElevator" type="Node2D"]
  24. script = ExtResource("1_0yjq3")
  25. [node name="CornerL" type="Sprite2D" parent="."]
  26. texture = ExtResource("2_lcqnt")
  27. region_enabled = true
  28. region_rect = Rect2(160, 128, 16, 16)
  29. [node name="ResourceSetterNew" type="Node" parent="CornerL" node_paths=PackedStringArray("node_to_affect")]
  30. script = ExtResource("3_5tm0t")
  31. node_to_affect = NodePath("..")
  32. property_name = "texture"
  33. mode = 1
  34. resource_json = ExtResource("4_ohybb")
  35. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  36. [node name="Middle" type="NinePatchRect" parent="."]
  37. offset_left = 8.0
  38. offset_top = -8.0
  39. offset_right = 48.0
  40. offset_bottom = 8.0
  41. texture = ExtResource("2_lcqnt")
  42. region_rect = Rect2(176, 128, 16, 16)
  43. axis_stretch_horizontal = 1
  44. [node name="ResourceSetterNew" type="Node" parent="Middle" node_paths=PackedStringArray("node_to_affect")]
  45. script = ExtResource("3_5tm0t")
  46. node_to_affect = NodePath("..")
  47. property_name = "texture"
  48. mode = 1
  49. resource_json = ExtResource("4_ohybb")
  50. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  51. [node name="CornerR" type="Sprite2D" parent="."]
  52. position = Vector2(56, 0)
  53. texture = ExtResource("2_lcqnt")
  54. region_enabled = true
  55. region_rect = Rect2(192, 128, 16, 16)
  56. [node name="ResourceSetterNew" type="Node" parent="CornerR" node_paths=PackedStringArray("node_to_affect")]
  57. script = ExtResource("3_5tm0t")
  58. node_to_affect = NodePath("..")
  59. property_name = "texture"
  60. mode = 1
  61. resource_json = ExtResource("4_ohybb")
  62. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  63. [node name="RPlatform" parent="CornerR" node_paths=PackedStringArray("linked_platform") instance=ExtResource("5_5qwbh")]
  64. unique_name_in_owner = true
  65. position = Vector2(0, 16)
  66. linked_platform = NodePath("../../LPlatform")
  67. [node name="LPlatform" parent="." node_paths=PackedStringArray("linked_platform") instance=ExtResource("5_5qwbh")]
  68. unique_name_in_owner = true
  69. position = Vector2(0, 64)
  70. linked_platform = NodePath("../CornerR/RPlatform")
  71. [node name="EditorPropertyExposer" type="Node" parent="."]
  72. script = ExtResource("6_lcqnt")
  73. properties = Array[String](["width", "left_height", "right_height"])
  74. metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
  75. [node name="Node" type="Node" parent="."]
  76. process_mode = 3
  77. script = SubResource("GDScript_0yjq3")
  78. [connection signal="modifier_applied" from="EditorPropertyExposer" to="Node" method="update"]