Example #1
0
 public LayerMixerChild(LayerMixerNode parent, NodeBase node) : base(parent, node)
 {
     priority   = 0;
     isAdditive = false;
     avatarMask = emptyMask;
     ParentNode = parent;
 }
        private void Awake()
        {
            graph = PlayableGraph.Create(graphName);
            graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime);

            var job = new AnimationIKApplyJobPlayable();

            animationPostprocess = AnimationScriptPlayable.Create(graph, job, 1);
            animationOutput      = ScriptPlayable <IKAnimationOutputBehavior> .Create(graph,
                                                                                      new IKAnimationOutputBehavior { postprocess = animationPostprocess });

            animationOutput.SetTraversalMode(PlayableTraversalMode.Mix);
            animationPostprocess.ConnectInput(0, animationOutput, 0);

            animatorOutput = AnimationPlayableOutput.Create(graph, graphName + ".Animation", playableAnimator);
            animatorOutput.SetSourcePlayable(animationPostprocess);

            rootLayerMixer = new LayerMixerNode(graph, gameObject);
            AttachOutputs(rootLayerMixer);

            graph.Play();
        }