Last active
March 16, 2018 04:02
-
-
Save neogeek/381e62676ab2d3508600053aaacf39fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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