diff options
Diffstat (limited to 'Assets/Scripts/Effects/AfterImage')
4 files changed, 0 insertions, 173 deletions
diff --git a/Assets/Scripts/Effects/AfterImage/AfterImage.cs b/Assets/Scripts/Effects/AfterImage/AfterImage.cs deleted file mode 100644 index 7f40e119..00000000 --- a/Assets/Scripts/Effects/AfterImage/AfterImage.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class AfterImage : MonoBehaviour -{ - public Animator myAnimator; - //public CharacterControl myCharacterControl; - public Renderer[] myRenderers; - - public Animator targetAnimator; - public GameObject targetObject; - - public float time; - public float intensity; - public float pow; - public float timeMax = 45; - - public bool active; - - // Use this for initialization - void Start() - { - //targetObject = - } - - // Update is called once per frame - void Update() - { - if (time > 0) - { - time--; - active = true; - intensity = (time / timeMax) * 10 * pow; - UpdateRenderer(); - } - else - { - active = false; - intensity = 0; - this.transform.gameObject.SetActive(false); - } - } - - void UpdateRenderer() - { - foreach(var renderer in myRenderers)
- {
- for(int i = 0;i < renderer.materials.Length; ++i)
- {
- renderer.materials[i].SetFloat("_Intensity", intensity);
- renderer.materials[i].SetFloat("_MKGlowPower", intensity); - } - }
- } - - public void Activate() - { - active = true; - transform.position = targetObject.transform.position; - transform.localScale = targetObject.transform.lossyScale; - transform.rotation = targetObject.transform.rotation; - transform.gameObject.SetActive(true); - - myAnimator.Play(targetAnimator.GetCurrentAnimatorStateInfo(0).shortNameHash, 0, targetAnimator.GetCurrentAnimatorStateInfo(0).normalizedTime); - - myAnimator.speed = 0.02f; - myAnimator.Update(1/60f); - time = timeMax + 1; - Update(); - } - -}
\ No newline at end of file diff --git a/Assets/Scripts/Effects/AfterImage/AfterImage.cs.meta b/Assets/Scripts/Effects/AfterImage/AfterImage.cs.meta deleted file mode 100644 index cd1fd19a..00000000 --- a/Assets/Scripts/Effects/AfterImage/AfterImage.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5912e1e5f1e32ea429bf6a9ec2d11a0f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: 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<AfterImage> afterImages; - - public int interval = 10; - - public int time = 0; - - private bool isActive = false; - - // Use this for initialization - void Start() - { - afterImages = new List<AfterImage>(poolSize); - for (int i = 0; i < poolSize; i++) - { - GameObject nextAfterImage = Instantiate(prefab); - nextAfterImage.transform.SetParent(this.transform); -
- nextAfterImage.GetComponent<AfterImage>().targetObject = targetObject; //Game Object Target - nextAfterImage.GetComponent<AfterImage>().targetAnimator = targetAnimator; //Animator Target
-
- nextAfterImage.SetActive(false);
-
- afterImages.Add(nextAfterImage.GetComponent<AfterImage>());
- }
- 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 diff --git a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs.meta b/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs.meta deleted file mode 100644 index 78d84907..00000000 --- a/Assets/Scripts/Effects/AfterImage/AfterImagePool.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 4aaea939b0abb3c4eb78963aedf4b2f3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: |