예제 #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);
        }