public static TState CreateState <TState>() where TState : State, new() { var state = PoolStates <TState> .Spawn(); ME.WeakRef.Reg(state); state.tick = default; state.randomState = default; return(state); }
public static void ReleaseState <TState>(ref State state) where TState : State, new() { if (state == null) { return; } state.tick = default; state.randomState = default; PoolStates <TState> .Recycle((TState)state); state = null; }
public static void ReleaseState <TState>(ref TState state) where TState : State, new() { state.tick = default; state.randomState = default; PoolStates <TState> .Recycle(ref state); }