Beispiel #1
0
        private void Initialize()
        {
            if (m_IsInitialized)
            {
                return;
            }
            m_Animator = GetComponent <Animator>();
            m_Graph    = PlayableGraph.Create();
            m_Graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime);
            m_StateController = new PlayableStateController(m_Graph);

            var template = new PlayableAmimatorDriver();

            template.Initialize(m_Graph, m_StateController);
            m_OutputPlayable = ScriptPlayable <PlayableAmimatorDriver> .Create(m_Graph, template, 1);

            AnimationPlayableUtilities.Play(m_Animator, m_OutputPlayable, m_Graph);

            m_IsInitialized = true;
        }
Beispiel #2
0
 public void Initialize(PlayableGraph graph, PlayableStateController ctrl)
 {
     m_Graph           = graph;
     m_StateController = ctrl;
 }