Ejemplo n.º 1
0
        void Tick()
        {
            int nextState = (_curSimStateIndex + 1) % _simStates.Length;

            _simJobHandle = _simulation.Tick(_simStates[_curSimStateIndex], _simStates[nextState], StaticState, _tempState, WorldData, _simJobHandle);
            _simJobHandle.Complete();
            _curSimStateIndex = nextState;
            SimTickEvent?.Invoke(_simStates[nextState]);
        }
Ejemplo n.º 2
0
        public void Edit(EditSimStateFunc editSimState)
        {
            _simJobHandle.Complete();

            int nextStateIndex = (_curSimStateIndex + 1) % _simStates.Length;
            var lastState      = _simStates[_curSimStateIndex];
            var nextState      = _simStates[nextStateIndex];

            _curSimStateIndex = nextStateIndex;

            editSimState(lastState, nextState);

            SimTickEvent?.Invoke(nextState);
        }