Hi, I recently using the animation editor in Unity3D controls several values in my script (MonoBehavior). I know that the animation editor in Unity3D can control the properties you exposed in Inspector, and I think maybe it obey the rule of property getset function in C#, so I create a MonoBehavior something like this:
public class Test : MonoBehaviour {
[SerializeField] float _val = 1.0f;
public float val {
get { return _val; }
set { _val = value; Debug.Log("value changed " + _val); }
}
}
Then I create a AnimationClip adjust the Test.val from 1.0f to 10.0f in one second. As the picture shows:
In the game, I play this animation. What I expect is the Val can changed by animation and calling the set function to print the log. But it only changed the _val, so I guess the Animation Editor in Unity3D changes properties directly without checking if it has the get/set function.
My question is:
How can I let the Animation Editor changes properties by invoking their set function ?
