public TState RemoveFsmState <TState>() where TState : FsmState <T> { Type tp = typeof(TState); string stateName = tp.FullName; if (!m_States.ContainsKey(stateName)) { throw new GameFrameworkException(string.Format("FSM '{0}' state '{1}' is already exist.", stateName, stateName)); } TState tst = m_States[stateName] as TState; m_States.Remove(stateName); tst.OnDestroy(this); return(tst); }