private IEnumerator Execute() { int lengthCommand = m_listCommandExecute.Count; if (lengthCommand == 0) { m_onExecuteEnd.Invoke(); yield break; } m_onExecuteRunning.Invoke(); m_playerManager.Apply(m_listCommandExecute[0]); m_counterGameplayManager.AddCommand(); yield return(new WaitForSeconds(m_duration)); m_applySystemBehaviour.Invoke(); yield return(new WaitForSeconds(m_duration)); if (lengthCommand > 0) { m_listCommandExecute.RemoveAt(0); StartCoroutine(Execute()); } }