public bool DestroyFsm(FsmBase fsm) { if (fsm == null) { Logger.LogError("FSM is invalid."); } return(InternalDestroyFsm(fsm.OwnerType)); }
private FsmBase InternalGetFsm(Type type) { FsmBase tmpFsm = null; if (mFsms.TryGetValue(type, out tmpFsm)) { return(tmpFsm); } return(null); }
private bool InternalDestroyFsm(Type type) { FsmBase tmpFsm = null; if (mFsms.TryGetValue(type, out tmpFsm)) { tmpFsm.Shutdown(); return(mFsms.Remove(type)); } return(false); }
public FsmBase[] GetAllFsms() { int tmpIndex = 0; FsmBase[] tmpFsms = new FsmBase[mFsms.Count]; Dictionary <Type, FsmBase> .Enumerator tmpItor = mFsms.GetEnumerator(); while (tmpItor.MoveNext()) { tmpFsms[tmpIndex++] = tmpItor.Current.Value; } return(tmpFsms); }