コード例 #1
0
 // Use this for initialization
 void Start()
 {
     animator = GetComponent <Animator>();
     mixer    = AnimationMixerPlayable.Create();
     mixer.SetInputs(new[] { idle, walk });
     animator.Play(mixer);
 }
コード例 #2
0
    void Start()
    {
        clip.wrapMode = WrapMode.Once;

        // Wrap the clip and the controller in playables
        clipPlayable       = AnimationClipPlayable.Create(clip);
        controllerPlayable = AnimatorControllerPlayable.Create(animController);
        mixer = AnimationMixerPlayable.Create();
        mixer.SetInputs(new Playable[] { clipPlayable, controllerPlayable });
    }
コード例 #3
0
    public AnimationPlayableInstance(Animator _animator, AnimationPlayableBaseNode node)
    {
        animator = _animator;

        mixer = AnimationMixerPlayable.Create();

        AnimationClip c = node.Inputs[0].GetValue <AnimationClip>();

        AnimationClip[] sources = node.Inputs.Select(x => x.GetValue <AnimationClip>()).ToArray();
        mixer.SetInputs(sources);
    }