public static AnimAction Create(E_Type type) { AnimAction action; int index = (int)type; if (m_UnusedActions[index].Count > 0) { action = m_UnusedActions[index].Dequeue(); } else { switch (type) { case E_Type.Idle: action = new AnimActionIdle(); break; case E_Type.PlayAnim: action = new AnimActionPlayAnim(); break; case E_Type.Move: action = new AnimActionMove(); break; case E_Type.UseSkill: action = new AnimActionUseSkill(); break; case E_Type.Death: action = new AnimActionDeath(); break; case E_Type.Hurt: action = new AnimActionHurt(); break; default: Debug.LogError("no AgentAction to create"); return(null); } } action.Reset(); action.SetActive(); return(action); }
protected override void Initialize(AnimAction action) { base.Initialize(action); Action = action as AnimActionMove; }