예제 #1
0
        /// <summary>
        /// 添加一个状态
        /// </summary>
        /// <param name="type"></param>
        /// <param name="state"></param>
        public void AddState(TState type, BaseCharaState state)
        {
            int key = Enum <TState> .Int(type);

            state.Self = SelfBaseUnit as TUnit;
            if (States.ContainsKey(key))
            {
                States[key] = state;
            }
            else
            {
                States.Add(key, state);
            }
        }
예제 #2
0
 /// <summary>
 /// 添加一个状态
 /// </summary>
 /// <param name="type"></param>
 /// <param name="state"></param>
 public void AddState(TState type, BaseCharaState state)
 {
     Machine.AddState(type, state);
 }