Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public static void ReleaseState <TState>(ref TState state) where TState : State, new()
 {
     state.tick        = default;
     state.randomState = default;
     PoolStates <TState> .Recycle(ref state);
 }