From f900853952635a6e82e24fe62548d171823afda0 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Sep 2021 17:47:20 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E7=B2=92=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=9C=A8=E7=BC=96=E8=BE=91=E5=99=A8=E4=B8=8B=E7=9A=84=E6=92=AD?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Projectile/Projectile.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Assets/Scripts/Projectile') 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 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; -- cgit v1.1-26-g67d0