Browse Source

:truck: Move trail material into a dedicated resource

In order to tidy things and make material management consistent across
all particle effects.
DricomDragon 2 years ago
parent
commit
6bd4a242ae

+ 3 - 20
godot/effect/particle/trail/Trail.tscn

@@ -1,27 +1,10 @@
-[gd_scene load_steps=5 format=2]
+[gd_scene load_steps=3 format=2]
 
 [ext_resource path="res://effect/particle/trail/trail_particle.png" type="Texture" id=1]
-[ext_resource path="res://effect/particle/trail/decrease_curve.tres" type="Curve" id=2]
-
-[sub_resource type="CurveTexture" id=1]
-curve = ExtResource( 2 )
-
-[sub_resource type="ParticlesMaterial" id=2]
-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( 1 )
+[ext_resource path="res://effect/particle/trail/trail_material.tres" type="Material" id=2]
 
 [node name="Trail" type="Particles2D"]
 lifetime = 0.1
 local_coords = false
-process_material = SubResource( 2 )
+process_material = ExtResource( 2 )
 texture = ExtResource( 1 )

+ 20 - 0
godot/effect/particle/trail/trail_material.tres

@@ -0,0 +1,20 @@
+[gd_resource type="ParticlesMaterial" load_steps=3 format=2]
+
+[ext_resource path="res://effect/particle/trail/decrease_curve.tres" type="Curve" id=1]
+
+[sub_resource type="CurveTexture" id=1]
+curve = ExtResource( 1 )
+
+[resource]
+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( 1 )