diff options
| author | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 | 
|---|---|---|
| committer | chai <215380520@qq.com> | 2023-10-27 11:05:14 +0800 | 
| commit | 766cdff5ffa72b65d7f106658d1603f47739b2ba (patch) | |
| tree | 34d7799a94dfa9be182825577583c0fa6dc935f7 /GameCode/CurveAnimationInstance.cs | |
+ init
Diffstat (limited to 'GameCode/CurveAnimationInstance.cs')
| -rw-r--r-- | GameCode/CurveAnimationInstance.cs | 73 | 
1 files changed, 73 insertions, 0 deletions
| diff --git a/GameCode/CurveAnimationInstance.cs b/GameCode/CurveAnimationInstance.cs new file mode 100644 index 0000000..6d5ed2f --- /dev/null +++ b/GameCode/CurveAnimationInstance.cs @@ -0,0 +1,73 @@ +using System; +using Sirenix.OdinInspector; +using UnityEngine; +using UnityEngine.Events; + +[Serializable] +public class CurveAnimationInstance +{ +	[FoldoutGroup("$animationUse", 0)] +	public CurveAnimationType animationType; + +	[FoldoutGroup("$animationUse", 0)] +	public CurveAnimationUse animationUse; + +	[ShowIf("animationUse", CurveAnimationUse.In, true)] +	[FoldoutGroup("$animationUse", 0)] +	public AnimationCurve inCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f); + +	[ShowIf("animationUse", CurveAnimationUse.Out, true)] +	[FoldoutGroup("$animationUse", 0)] +	public AnimationCurve outCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f); + +	[ShowIf("animationUse", CurveAnimationUse.Boop, true)] +	[FoldoutGroup("$animationUse", 0)] +	public AnimationCurve boopCurve = AnimationCurve.Linear(0f, 1f, 1f, 1f); + +	[HideIf("animationType", CurveAnimationType.Scale, true)] +	[FoldoutGroup("$animationUse", 0)] +	public Vector3 animDirection; + +	[FoldoutGroup("$animationUse/Settings", 0)] +	public bool loop; + +	[FoldoutGroup("$animationUse/Settings", 0)] +	public bool playOnAwake; + +	[FoldoutGroup("$animationUse/Settings", 0)] +	public float speed = 1f; + +	[FoldoutGroup("$animationUse/Settings", 0)] +	public float multiplier = 1f; + +	[FoldoutGroup("$animationUse/Events", 0)] +	public UnityEvent statEvent; + +	[FoldoutGroup("$animationUse/Events", 0)] +	public UnityEvent endEvent; + +	[FoldoutGroup("$animationUse/Events", 0)] +	public UnityEvent delayedEvent; + +	[FoldoutGroup("$animationUse/Events", 0)] +	public float delay; + +	[FoldoutGroup("$animationUse/Debug", 0, Order = 0, Expanded = false)] +	public bool isPlaying; + +	[HideInInspector] +	public Coroutine animation; + +	public AnimationCurve Curve() +	{ +		if (animationUse == CurveAnimationUse.Boop) +		{ +			return boopCurve; +		} +		if (animationUse != 0) +		{ +			return outCurve; +		} +		return inCurve; +	} +} | 
