Reworked CollisionSwitcher to the arrays
This commit is contained in:
@@ -17,6 +17,6 @@ enum PlatformColor {
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
collision_switcher.material = platform_sprite.material
|
||||
collision_switcher.add_material(platform_sprite.material)
|
||||
if initial_color == PlatformColor.Black:
|
||||
collision_switcher.switch_color()
|
||||
|
||||
@@ -37,5 +37,5 @@ material = SubResource("ShaderMaterial_vbsvi")
|
||||
[node name="CollisionShape2D" parent="." index="2" unique_id=175449124]
|
||||
shape = SubResource("RectangleShape2D_pbfpg")
|
||||
|
||||
[node name="CollisionSwitcher" parent="." index="3" unique_id=542648449 node_paths=PackedStringArray("object") instance=ExtResource("6_mk014")]
|
||||
object = NodePath("..")
|
||||
[node name="CollisionSwitcher" parent="." index="3" unique_id=542648449 node_paths=PackedStringArray("objects") instance=ExtResource("6_mk014")]
|
||||
objects = [NodePath("..")]
|
||||
|
||||
@@ -4,6 +4,8 @@ extends AbstractColorPlatform
|
||||
|
||||
|
||||
@onready var touch_check_collision: CollisionShape2D = $Area2D/CollisionShape2D
|
||||
@onready var area_collision_switcher : CollisionSwitcher = $CollisionSwitcher
|
||||
|
||||
|
||||
func rebuild_platform() -> void:
|
||||
super.rebuild_platform()
|
||||
|
||||
@@ -35,7 +35,12 @@ material = SubResource("ShaderMaterial_wa58h")
|
||||
[node name="CollisionShape2D" parent="." index="2" unique_id=175449124]
|
||||
shape = SubResource("RectangleShape2D_vol56")
|
||||
|
||||
[node name="CollisionSwitcher" parent="." index="3" unique_id=542648449 node_paths=PackedStringArray("objects")]
|
||||
objects = [NodePath(".."), NodePath("../Area2D")]
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="." index="4" unique_id=1655744842]
|
||||
collision_layer = 0
|
||||
collision_mask = 192
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" index="0" unique_id=1261028767]
|
||||
position = Vector2(0, -4.5)
|
||||
|
||||
Reference in New Issue
Block a user