diff options
author | chai <chaifix@163.com> | 2020-11-16 21:08:39 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-11-16 21:08:39 +0800 |
commit | 01f06fb513dab303abeb02d7e1007e397874bcc0 (patch) | |
tree | 4df198ef7829471831fcf0c9361b773ea9501d2f /Assets/Scripts/Effects/Spark.cs | |
parent | ac2b469bd76d7d91d10894184cbddad0796ce7bc (diff) |
*misc
Diffstat (limited to 'Assets/Scripts/Effects/Spark.cs')
-rw-r--r-- | Assets/Scripts/Effects/Spark.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Assets/Scripts/Effects/Spark.cs b/Assets/Scripts/Effects/Spark.cs new file mode 100644 index 00000000..5f8856c4 --- /dev/null +++ b/Assets/Scripts/Effects/Spark.cs @@ -0,0 +1,36 @@ +using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class Spark : MonoBehaviour
+{
+ public string Name;
+ public float LifeTime;
+
+ private float time;
+
+ public Transform Host;
+
+ private void Awake()
+ {
+ }
+
+ private void OnEnable()
+ {
+ time = 0;
+ }
+
+ private void Update()
+ {
+ time += Time.deltaTime;
+ if(time > LifeTime)
+ {
+ SparksManager.Instance.CycleSpark(this);
+ }
+ if (Host != null)
+ {
+ transform.position = Host.position;
+ }
+ }
+
+}
|