From 22891bf59032ba88262824255a706d652031384b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 10 Mar 2022 14:07:40 +0800 Subject: * move folder --- .../Scripts/Effects/AfterImage/AfterImagePool.cs | 78 ---------------------- 1 file changed, 78 deletions(-) delete mode 100644 Assets/Scripts/Effects/AfterImage/AfterImagePool.cs (limited to 'Assets/Scripts/Effects/AfterImage/AfterImagePool.cs') diff --git a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs deleted file mode 100644 index 38d3488d..00000000 --- a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class AfterImagePool : MonoBehaviour -{ - public static AfterImagePool Instance; - - //public CharacterControl myCharacterControl; - public GameObject targetObject; //Set these manually to the character object you're copying - public Animator targetAnimator; //Set these manually to the character object you're copying - public GameObject prefab; //This is the prefab you made in the scene. It's a parent transform with an animator and AfterImage script on it, with Armature and SkinnedMeshRenderer children - public int poolSize = 10; - public List afterImages; - - public int interval = 10; - - public int time = 0; - - private bool isActive = false; - - // Use this for initialization - void Start() - { - afterImages = new List(poolSize); - for (int i = 0; i < poolSize; i++) - { - GameObject nextAfterImage = Instantiate(prefab); - nextAfterImage.transform.SetParent(this.transform); - - nextAfterImage.GetComponent().targetObject = targetObject; //Game Object Target - nextAfterImage.GetComponent().targetAnimator = targetAnimator; //Animator Target - - nextAfterImage.SetActive(false); - - afterImages.Add(nextAfterImage.GetComponent()); - } - Instance = this; - } - - // Update is called once per frame - void Update() - { - if (!isActive) - return; - - time++; - if (time >= interval) - { - time = 0; - AddAfterImage(); - } - } - - void AddAfterImage() - { - for (int i = 0; i < poolSize; i++) - { - if (!afterImages[i].active) - { - afterImages[i].Activate(); - break; - } - } - } - - public void Activate(bool isActive) - { - this.isActive = isActive; - time = isActive ? interval : 0; - } - - public void SetInterval(int interval) - { - this.interval = interval; - } - -} \ No newline at end of file -- cgit v1.1-26-g67d0