#pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释 /// <summary> /// 分配状态 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Allocate <T>() where T : BaseState, new () { var state = _pool.Get <T>(); state.recorder = this; return(state); }
internal void TryChangeState <T>(Action <T> stInitFunc = null) where T : State { var st = mStatePool.Get <T>(); if (stInitFunc != null) { stInitFunc.Invoke(st); } this.TryChangeState(st); }