Ejemplo n.º 1
0
        async Task Profile(CancellationToken canceller)
        {
            // auto profile
            var mask = new GameEntityMask(null, null, null);

            using (var gridProfiler = new GridProfiler(mask))
                using (var playerProfiler = new PlayerProfiler(mask))
                    using (ProfilerResultQueue.Profile(gridProfiler))
                        using (ProfilerResultQueue.Profile(playerProfiler))
                        {
                            Log.Trace("auto-profile started");
                            gridProfiler.MarkStart();
                            playerProfiler.MarkStart();
                            await Task.Delay(_config.IntervalFrequency.Seconds(), canceller);

                            Log.Trace("auto-profile done");

                            _grids.Update(gridProfiler.GetResult());
                            _players.Update(playerProfiler.GetResult());
                        }

            Log.Trace("profile done");
        }
Ejemplo n.º 2
0
 void Awake()
 {
     instance = this;
 }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        health = maxHealth;

        playerpro = gameObject.GetComponent <PlayerProfiler>();
    }