/// <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); } }
/// <summary> /// 添加一个状态 /// </summary> /// <param name="type"></param> /// <param name="state"></param> public void AddState(TState type, BaseCharaState state) { Machine.AddState(type, state); }