예제 #1
0
        /// <summary>
        /// 注册状态机
        /// </summary>
        /// <param name="fsm">状态机</param>
        public void RegisterFSM(FSM fsm)
        {
            if (!FSMs.ContainsKey(fsm.Name))
            {
                FSMs.Add(fsm.Name, fsm);

                if (FSMGroups.ContainsKey(fsm.Group))
                {
                    FSMGroups[fsm.Group].Add(fsm);
                }
                else
                {
                    FSMGroups.Add(fsm.Group, new List <FSM>());
                    FSMGroups[fsm.Group].Add(fsm);
                }
            }
            else
            {
                throw new HTFrameworkException(HTFrameworkModule.FSM, "注册状态机失败:已存在状态机 " + fsm.Name + " !");
            }
        }
예제 #2
0
 /// <summary>
 /// 移除已注册的状态机
 /// </summary>
 /// <param name="fsm">状态机</param>
 public void UnRegisterFSM(FSM fsm)
 {
     _helper.UnRegisterFSM(fsm);
 }
예제 #3
0
 /// <summary>
 /// 注册状态机
 /// </summary>
 /// <param name="fsm">状态机</param>
 public void RegisterFSM(FSM fsm)
 {
     _helper.RegisterFSM(fsm);
 }
예제 #4
0
 private void OnEnable()
 {
     _target = target as FSM;
 }