diff options
| author | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-20 22:36:58 +0800 |
| commit | a22c505984697881f5f911a165ee022087b69e09 (patch) | |
| tree | d3c030aef1ae9b8a01c889dd2902bb1e3324e72b /Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs | |
| parent | 4a4cc82d069b26bc4d4532e73860f86b211ca239 (diff) | |
Diffstat (limited to 'Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs')
| -rw-r--r-- | Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs b/Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs deleted file mode 100644 index 9549100..0000000 --- a/Thronefall_1_0/Decompile/UnitCommandRadiusAnimation.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Collections; -using UnityEngine; - -public class UnitCommandRadiusAnimation : MonoBehaviour -{ - public AnimationCurve animationCurve; - - public AnimationCurve hideCurve; - - public float animationTime; - - public float hideTime = 0.25f; - - private bool active; - - public bool Active => active; - - private void Start() - { - if (!active) - { - base.gameObject.SetActive(value: false); - } - } - - public void Activate() - { - active = true; - StopAllCoroutines(); - base.gameObject.SetActive(value: true); - StartCoroutine(AnimateShow()); - } - - public void Deactivate() - { - active = false; - if (base.gameObject.activeSelf) - { - StopAllCoroutines(); - StartCoroutine(AnimateHide()); - } - } - - private IEnumerator AnimateShow() - { - float timer = 0f; - while (timer <= animationTime) - { - timer += Time.deltaTime; - base.transform.localScale = Vector3.one * animationCurve.Evaluate(Mathf.InverseLerp(0f, animationTime, timer)); - yield return null; - } - base.transform.localScale = Vector3.one; - } - - private IEnumerator AnimateHide() - { - Debug.Log("START ANIMATION"); - float timer = 0f; - while (timer <= hideTime) - { - timer += Time.deltaTime; - base.transform.localScale = Vector3.one * hideCurve.Evaluate(Mathf.InverseLerp(0f, hideTime, timer)); - yield return null; - } - base.transform.localScale = Vector3.zero; - base.gameObject.SetActive(value: false); - } -} |
