Inheritance: AnimationPlayable
    void Start()
    {
        mixer = new AnimationMixerPlayable();
        mixer.SetInputs( new []{ clip_0, clip_1 }  );

        GetComponent<Animator>().Play( mixer );
    }
 public static int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.Experimental.Director.AnimationMixerPlayable o;
         if(argc==1){
             o=new UnityEngine.Experimental.Director.AnimationMixerPlayable();
             pushValue(l,true);
             pushValue(l,o);
             return 2;
         }
         else if(argc==2){
             System.Boolean a1;
             checkType(l,2,out a1);
             o=new UnityEngine.Experimental.Director.AnimationMixerPlayable(a1);
             pushValue(l,true);
             pushValue(l,o);
             return 2;
         }
         return error(l,"New object failed.");
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
Beispiel #3
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.Experimental.Director.AnimationMixerPlayable o;
         if (argc == 1)
         {
             o = new UnityEngine.Experimental.Director.AnimationMixerPlayable();
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 2)
         {
             System.Boolean a1;
             checkType(l, 2, out a1);
             o = new UnityEngine.Experimental.Director.AnimationMixerPlayable(a1);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    void Start()
    {
        // Wrap the clip and the controller in playables
        AnimationClipPlayable clip_playable = new AnimationClipPlayable( clip );
        AnimatorControllerPlayable controller_playable = new AnimatorControllerPlayable( anim_controller );
        AnimationMixerPlayable mixer = new AnimationMixerPlayable();
        mixer.SetInputs( new AnimationPlayable[] {clip_playable, controller_playable} );

        // Bind the playable graph to the player
        GetComponent<Animator>().Play( mixer );
    }
 static public int get_handle(IntPtr l)
 {
     try {
         UnityEngine.Experimental.Director.AnimationMixerPlayable self = (UnityEngine.Experimental.Director.AnimationMixerPlayable)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.handle);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Experimental.Director.AnimationMixerPlayable o;
         o = new UnityEngine.Experimental.Director.AnimationMixerPlayable();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int set_handle(IntPtr l)
 {
     try {
         UnityEngine.Experimental.Director.AnimationMixerPlayable self = (UnityEngine.Experimental.Director.AnimationMixerPlayable)checkSelf(l);
         UnityEngine.Experimental.Director.PlayableHandle         v;
         checkValueType(l, 2, out v);
         self.handle = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Beispiel #8
0
 static public int SetInputs(IntPtr l)
 {
     try {
         UnityEngine.Experimental.Director.AnimationMixerPlayable self = (UnityEngine.Experimental.Director.AnimationMixerPlayable)checkSelf(l);
         UnityEngine.AnimationClip[] a1;
         checkArray(l, 2, out a1);
         var ret = self.SetInputs(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 internal static bool SetInputs(AnimationMixerPlayable playable, AnimationClip[] clips)
 {
     if (clips == null)
     {
         throw new NullReferenceException("Parameter clips was null. You need to pass in a valid array of clips.");
     }
     Playables.BeginIgnoreAllocationTracker();
     Playable[] sources = new Playable[clips.Length];
     for (int i = 0; i < clips.Length; i++)
     {
         sources[i] = (Playable) AnimationClipPlayable.Create(clips[i]);
         Playable target = sources[i];
         Playables.SetPlayableDeleteOnDisconnect(ref target, true);
     }
     Playables.EndIgnoreAllocationTracker();
     return SetInputsValidated((AnimationPlayable) playable, sources, typeof(AnimationMixerPlayable));
 }
    private void AddNodeRandomly()
    {
        // Pick one mixer randomly, and create either another mixer or a leaf
        int parentIndex = Random.Range(0, m_Mixers.Count);
        AnimationMixerPlayable parent = m_Mixers[parentIndex];
        AnimationPlayable newNode;

        if (Random.value > k_ProportionOfLeaves)
        {
            newNode = new AnimationMixerPlayable();
            m_Mixers.Add(newNode as AnimationMixerPlayable);
        }
        else
        {
            newNode = new AnimationClipPlayable(null);
        }

        parent.AddInput(newNode);
        parent.SetInputWeight(parent.GetInputs().Length - 1, Random.value);

        // Call this to visualize the graph in the graph visualizer. Will only be effective if window is open.
        GraphVisualizerClient.Show(m_Root, gameObject.name);
    }
 internal static extern void InternalCreate(ref AnimationMixerPlayable that);
 private void InitializeGraph()
 {
     m_Root = new AnimationMixerPlayable();
     m_Mixers.Clear();
     m_Mixers.Add(m_Root);
 }