From 01f06fb513dab303abeb02d7e1007e397874bcc0 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 16 Nov 2020 21:08:39 +0800 Subject: *misc --- Assets/Scripts/Effects/Spark.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Assets/Scripts/Effects/Spark.cs (limited to 'Assets/Scripts/Effects/Spark.cs') 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; + } + } + +} -- cgit v1.1-26-g67d0