Forráskód Böngészése

:truck: Move trail into a dedicated scene

DricomDragon 2 éve
szülő
commit
404e4854b3

+ 3 - 27
godot/component/entity/ball/Ball.tscn

@@ -1,8 +1,8 @@
-[gd_scene load_steps=9 format=2]
+[gd_scene load_steps=6 format=2]
 
 [ext_resource path="res://component/entity/ball/Ball.gd" type="Script" id=1]
 [ext_resource path="res://component/entity/ball/ball.png" type="Texture" id=2]
-[ext_resource path="res://component/entity/ball/ball_particle.png" type="Texture" id=3]
+[ext_resource path="res://effect/particle/trail/Trail.tscn" type="PackedScene" id=3]
 
 [sub_resource type="PhysicsMaterial" id=1]
 friction = 0.0
@@ -11,26 +11,6 @@ bounce = 1.0
 [sub_resource type="CircleShape2D" id=2]
 radius = 5.0
 
-[sub_resource type="Curve" id=3]
-_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.290909 ), 0.0, 0.0, 0, 0 ]
-
-[sub_resource type="CurveTexture" id=4]
-curve = SubResource( 3 )
-
-[sub_resource type="ParticlesMaterial" id=5]
-flag_disable_z = true
-spread = 0.0
-gravity = Vector3( 0, 0, 0 )
-angular_velocity = 45.0
-angular_velocity_random = 1.0
-orbit_velocity = 0.0
-orbit_velocity_random = 0.0
-angle = 180.0
-angle_random = 1.0
-scale = 0.5
-scale_random = 0.5
-scale_curve = SubResource( 4 )
-
 [node name="Ball" type="RigidBody2D" groups=[
 "ball",
 ]]
@@ -52,9 +32,5 @@ shape = SubResource( 2 )
 [node name="Sprite" type="Sprite" parent="."]
 texture = ExtResource( 2 )
 
-[node name="Trail" type="Particles2D" parent="."]
-lifetime = 0.1
-local_coords = false
-process_material = SubResource( 5 )
-texture = ExtResource( 3 )
+[node name="Trail" parent="." instance=ExtResource( 3 )]
 [connection signal="body_exited" from="." to="." method="_on_Ball_body_exited"]

+ 31 - 0
godot/effect/particle/trail/Trail.tscn

@@ -0,0 +1,31 @@
+[gd_scene load_steps=5 format=2]
+
+[ext_resource path="res://effect/particle/trail/trail_particle.png" type="Texture" id=1]
+
+
+
+[sub_resource type="Curve" id=1]
+_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.290909 ), 0.0, 0.0, 0, 0 ]
+
+[sub_resource type="CurveTexture" id=2]
+curve = SubResource( 1 )
+
+[sub_resource type="ParticlesMaterial" id=3]
+flag_disable_z = true
+spread = 0.0
+gravity = Vector3( 0, 0, 0 )
+angular_velocity = 45.0
+angular_velocity_random = 1.0
+orbit_velocity = 0.0
+orbit_velocity_random = 0.0
+angle = 180.0
+angle_random = 1.0
+scale = 0.5
+scale_random = 0.5
+scale_curve = SubResource( 2 )
+
+[node name="Trail" type="Particles2D"]
+lifetime = 0.1
+local_coords = false
+process_material = SubResource( 3 )
+texture = ExtResource( 1 )

godot/component/entity/ball/decrease_curve.tres → godot/effect/particle/trail/decrease_curve.tres


godot/component/entity/ball/ball_particle.png → godot/effect/particle/trail/trail_particle.png


+ 3 - 3
godot/component/entity/ball/ball_particle.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/ball_particle.png-e3e73ccbc0d9fb737f0f8e1ca3a842de.stex"
+path="res://.import/trail_particle.png-4abe855f2c09108dbcd720308c41e5d2.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://component/entity/ball/ball_particle.png"
-dest_files=[ "res://.import/ball_particle.png-e3e73ccbc0d9fb737f0f8e1ca3a842de.stex" ]
+source_file="res://effect/particle/trail/trail_particle.png"
+dest_files=[ "res://.import/trail_particle.png-4abe855f2c09108dbcd720308c41e5d2.stex" ]
 
 [params]