1234567891011121314151617181920212223242526272829 |
- using System;
- using System.Linq;
- using UnityEngine;
- // ReSharper disable once CheckNamespace
- namespace QFX.SFX
- {
- [Serializable]
- public class SFX_AnimationModule
- {
- public AnimationCurve AnimationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
- public float ValueMultiplier = 1f;
- public float TimeMultiplier = 1f;
- public bool IsAnimationFinished { get; set; }
- public float Evaluate(float time)
- {
- var mTime = time / TimeMultiplier;
- var lastTime = AnimationCurve.keys.Last().time;
- if (mTime > lastTime)
- IsAnimationFinished = true;
- var eval = AnimationCurve.Evaluate(mTime) * ValueMultiplier;
- return eval;
- }
- }
- }
|