Advertisement
GibTreaty

AnimationCurveAsset.cs

Jan 10th, 2020
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. [CreateAssetMenu(fileName = "Animation Curve Asset")]
  4. public class AnimationCurveAsset : ScriptableObject {
  5.  
  6.     [SerializeField]
  7.     AnimationCurve _curve = AnimationCurve.Linear(0, 0, 1, 1);
  8.  
  9.     #region Properties
  10.     public AnimationCurve Curve {
  11.         get { return _curve; }
  12.         set { _curve = value; }
  13.     }
  14.     #endregion
  15.    
  16.     /// <summary>Input time and output curve value.</summary>
  17.     public float Evaluate(float time) {
  18.         return _curve.Evaluate(time);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement