diff options
author | chai <chaifix@163.com> | 2021-09-01 17:47:20 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-01 17:47:20 +0800 |
commit | f900853952635a6e82e24fe62548d171823afda0 (patch) | |
tree | 0d2c0bce3f7411c8ab61c13a5ade65bddbac6375 /Assets/Scripts/Projectile/Projectile.cs | |
parent | a93ea925263c23d5c08b5fca546eef81d6d4fec3 (diff) |
*修改粒子系统在编辑器下的播放
Diffstat (limited to 'Assets/Scripts/Projectile/Projectile.cs')
-rw-r--r-- | Assets/Scripts/Projectile/Projectile.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Assets/Scripts/Projectile/Projectile.cs b/Assets/Scripts/Projectile/Projectile.cs index b1eb1b61..a6411f5f 100644 --- a/Assets/Scripts/Projectile/Projectile.cs +++ b/Assets/Scripts/Projectile/Projectile.cs @@ -59,7 +59,7 @@ public class Projectile : MonoBehaviour private List<int> m_Hitmask;
- private float time;
+ public float time;
private bool markDestroy;
@@ -94,7 +94,7 @@ public class Projectile : MonoBehaviour {
this.transform.position += this.velocity * deltaTime;
time += deltaTime;
- if(time > this.lifetime || markDestroy)
+ if (time > this.lifetime || markDestroy)
{
DestroyImmediate(this.gameObject);
}
@@ -170,6 +170,9 @@ public class Projectile : MonoBehaviour if (spark)
{
GameObject obj = GameObject.Instantiate(spark);
+#if UNITY_EDITOR
+ obj.transform.SetParent(TimelineEventProxy.Root_Particles.transform);
+#endif
obj.transform.position = collision.collidee.unitCollider.owner.center;
markDestroy = true;
|