using UnityEngine;using System.Collections;public class setAnimationEvent : MonoBehaviour { public RuntimeAnimatorController m_runtimeAnimatorController; // Use this for initialization void Start () { m_runtimeAnimatorController = this.GetComponent().runtimeAnimatorController; AnimationEvent newEvent = new AnimationEvent(); newEvent.functionName = "print"; newEvent.time = 0.2f; m_runtimeAnimatorController.animationClips[0].AddEvent(newEvent); Debug.Log(m_runtimeAnimatorController.animationClips.Length.ToString()); this.GetComponent ().Rebind(); } // Update is called once per frame void Update () { } void print() { Debug.Log("ssss"); }}