diff options
author | chai <215380520@qq.com> | 2023-05-04 11:25:52 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-05-04 11:25:52 +0800 |
commit | 848097c88bbcf24934a375dff39cf4defa2819dd (patch) | |
tree | 85f4cc4d09fbf2a3839752449d21cb3e0bec8fa1 /marching/Assets/Scripts/Projectiles/BladeScript.cs | |
parent | ba1ad0efd8601dc4af023aca5a78609c55b4d67f (diff) |
*misc
Diffstat (limited to 'marching/Assets/Scripts/Projectiles/BladeScript.cs')
-rw-r--r-- | marching/Assets/Scripts/Projectiles/BladeScript.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/marching/Assets/Scripts/Projectiles/BladeScript.cs b/marching/Assets/Scripts/Projectiles/BladeScript.cs new file mode 100644 index 0000000..f5f613c --- /dev/null +++ b/marching/Assets/Scripts/Projectiles/BladeScript.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class BladeScript : ProjectileBase +{ + [NonSerialized] public float life; + + + private SpriteRenderer sr + { + get + { + return this.gameObject.GetComponent<SpriteRenderer>(); + } + } + + public void Start() + { + Invoke("DestroySelf", life); + } + + void DestroySelf() + { + Destroy(this.gameObject); + } + + public void Update() + { + Color c = sr.color; + c.a *= 0.99f; + sr.color = c; + } + + public void SetFlip(bool flip) + { + sr.flipX = flip; + } + +} |