Skip to content

Instantly share code, notes, and snippets.

@neogeek
Last active March 16, 2018 04:02
Show Gist options
  • Save neogeek/381e62676ab2d3508600053aaacf39fe to your computer and use it in GitHub Desktop.
Save neogeek/381e62676ab2d3508600053aaacf39fe to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public static class CustomExtensions
{
public static void EditKeyframeValue(this AnimationCurve animationCurve, int key, float value)
{
Keyframe[] keys = animationCurve.keys;
keys[key].value = value;
animationCurve.keys = keys;
}
public static void EditKeyframeValue(this CandyCoded.Vector3AnimationCurve animationCurve, int key, Vector3 vector)
{
animationCurve.x.EditKeyframeValue(key, vector.x);
animationCurve.y.EditKeyframeValue(key, vector.y);
animationCurve.z.EditKeyframeValue(key, vector.z);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment