public void ApplyState(PlayerState state)
        {
            StateMachine.Presimulate(state);
            var timeline = StateMachine.StateData.Timeline;

            if (timeline != Director.playableAsset)
            {
                Director.Play(timeline);
                stateDuration = Director.duration;
            }
            Director.time = state.StateTime % stateDuration;
            Director.Evaluate();
        }
        public void ApplyState(ref PlayerState state)
        {
            StateMachine.Presimulate(ref state);
            var timeline = StateMachine.GetControllerState(ref state).Data.Timeline;

            if (timeline != Director.playableAsset)
            {
                Director.Play(timeline);
                stateDuration = Director.duration;
                if (stateDuration == 0)
                {
                    stateDuration = 1;
                }
            }
            Director.time = state.StateTime % stateDuration;
            Director.Evaluate();
        }
        public void ApplyState(ref PlayerState state)
        {
            StateMachine.Presimulate(ref state);
            var stateInfo = GetControllerState(ref state);

            if (stateInfo == null)
            {
                return;
            }
            foreach (var controllerState in _states)
            {
                controllerState.Disconnect();
                controllerState.SetWeight(0f);
            }

            stateInfo.Connect();
            stateInfo.SetWeight(1f);
            stateInfo.SetTime(ref state);
            _playableGraph.Evaluate();
        }