private void GunshotWoundTick()
        {
            if (_isPaused)
            {
                return;
            }

            if (_mainConfig.PlayerConfig.WoundedPlayerEnabled)
            {
                _inputArguments[0] = Game.Player;
                _inputArguments[1] = 0f;
                Function.Call(Hash.SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER, _inputArguments);

                _inputArguments[0] = 0.01f;
                Function.Call(Hash.SET_AI_WEAPON_DAMAGE_MODIFIER, _inputArguments);
                Function.Call(Hash.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER, _inputArguments);
            }

            _inputArguments[0] = null;
            _everyFrameSystems.Run();
            _commonSystems.Run();

#if DEBUG
            GTA.UI.Screen.Screen.ShowSubtitle($"ActiveEntities: {_ecsWorld.GetStats().ActiveEntities.ToString()}\n" +
                                              $"Peds in GSW: {_gswWorld.GswPeds.Count.ToString()}");
#endif
        }
        private void GunshotWoundTick()
        {
            _debugStopwatch.Restart();
            _updateSystems.Run();
            _debugStopwatch.Stop();

            CheckTime(_debugStopwatch.ElapsedMilliseconds);

#if DEBUG
            string debugSubtitles = $"ActiveEntities: {_ecsWorld.GetStats().ActiveEntities}/{_mainConfig.TicksToRefresh}\n" +
                                    $"Peds: {_ecsWorld.GetFilter<EcsFilter<WoundedPedComponent>>().EntitiesCount}\n" +
                                    $"Ms: {_debugStopwatch.ElapsedMilliseconds}";
            UI.ShowSubtitle(debugSubtitles);
#endif
        }
Exemple #3
0
    void OnEnable()
    {
        _world = new EcsWorld()
                 .AddSystem(new SpawnSystem())
                 .AddSystem(new InputSystem())
                 .AddSystem(new ControlSystem())
                 .AddSystem(new MoveSystem())
                 .AddSystem(new CollisionSystem())
                 .AddSystem(new DestroySystem());
        _world.Initialize();

        _world.SubscribeToEvent <int> (OnScore);
        var stats = _world.GetStats();

        Debug.LogFormat("[Systems: {0}] [Entities: {1}/{2}] [Components: {3}] [Filters: {4}] [DelayedUpdates: {5}]",
                        stats.AllSystems, stats.AllEntities, stats.ReservedEntities, stats.Components, stats.Filters, stats.DelayedUpdates);
    }
Exemple #4
0
        private void GunshotWoundTick()
        {
            if (_isPaused)
            {
                return;
            }

            Function.Call(Hash.SET_PLAYER_WEAPON_DAMAGE_MODIFIER, Game.Player, 0.01f);
            Function.Call(Hash.SET_PLAYER_HEALTH_RECHARGE_MULTIPLIER, Game.Player, 0f);

            _everyFrameSystems.Run();
            _commonSystems.Run();

#if DEBUG
            string debugSubtitles = $"ActiveEntities: {_ecsWorld.GetStats().ActiveEntities}\n" +
                                    $"Peds in GSW: {_gswWorld.GswPeds.Count}";
            UI.ShowSubtitle(debugSubtitles);
#endif
        }
 public EcsWorldStats GetStats()
 {
     return(_world.GetStats());
 }