Example #1
0
 protected virtual void Start()
 {
     if (m_currentRunningState != null)
     {
         m_currentRunningState = Instantiate(m_currentRunningState);
         m_currentRunningState.Init(m_actor);
     }
 }
Example #2
0
        private void ChangeToNextState()
        {
            m_currentRunningState.OnExit();

            ScriptableObject _waitForDestroy = m_currentRunningState;

            m_currentRunningState = Instantiate(m_currentRunningState.NextState);
            Destroy(_waitForDestroy);
            m_currentRunningState.Init(m_actor);
        }