示例#1
0
        public bool DestroyFsm(FsmBase fsm)
        {
            if (fsm == null)
            {
                Logger.LogError("FSM is invalid.");
            }

            return(InternalDestroyFsm(fsm.OwnerType));
        }
示例#2
0
        private FsmBase InternalGetFsm(Type type)
        {
            FsmBase tmpFsm = null;

            if (mFsms.TryGetValue(type, out tmpFsm))
            {
                return(tmpFsm);
            }

            return(null);
        }
示例#3
0
        private bool InternalDestroyFsm(Type type)
        {
            FsmBase tmpFsm = null;

            if (mFsms.TryGetValue(type, out tmpFsm))
            {
                tmpFsm.Shutdown();
                return(mFsms.Remove(type));
            }

            return(false);
        }
示例#4
0
        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);
        }