Skip to content

Instantly share code, notes, and snippets.

@inertiave
Created November 18, 2019 07:36
Show Gist options
  • Select an option

  • Save inertiave/a6e5d2048e2ec296e1297fa0a44de169 to your computer and use it in GitHub Desktop.

Select an option

Save inertiave/a6e5d2048e2ec296e1297fa0a44de169 to your computer and use it in GitHub Desktop.
namespace UnityEngine {
[CreateAssetMenu(menuName = "Animation Curve", order = 400)]
public class AnimationCurveAsset : ScriptableObject {
public AnimationCurve curve = AnimationCurve.Linear(0, 0, 1, 1);
public static implicit operator AnimationCurve(AnimationCurveAsset me)
{
return me.curve;
}
public static implicit operator AnimationCurveAsset(AnimationCurve curve)
{
AnimationCurveAsset asset = CreateInstance<AnimationCurveAsset>();
asset.curve = curve;
return asset;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment