InsertAnimationEvent() private static method

private static InsertAnimationEvent ( AnimationEvent &events, AnimationClip clip, AnimationEvent evt ) : int
events UnityEngine.AnimationEvent
clip UnityEngine.AnimationClip
evt UnityEngine.AnimationEvent
return int
コード例 #1
0
        public static AnimationWindowEvent CreateAndEdit(GameObject root, AnimationClip clip, float time)
        {
            AnimationEvent animationEvent = new AnimationEvent();

            animationEvent.time = time;
            AnimationEvent[] animationEvents = AnimationUtility.GetAnimationEvents(clip);
            int num = AnimationWindowEvent.InsertAnimationEvent(ref animationEvents, clip, animationEvent);
            AnimationWindowEvent animationWindowEvent = ScriptableObject.CreateInstance <AnimationWindowEvent>();

            animationWindowEvent.hideFlags  = HideFlags.HideInHierarchy;
            animationWindowEvent.name       = "Animation Event";
            animationWindowEvent.root       = root;
            animationWindowEvent.clip       = clip;
            animationWindowEvent.clipInfo   = null;
            animationWindowEvent.eventIndex = num;
            return(animationWindowEvent);
        }