Exemple #1
0
        void Update()
        {
            _ecsWatch.Reset();
            _ecsWatch.Start();
            _world.RunUpdate();
            _ecsWatch.Stop();

            _unityResult = string.Format("unity: {0}ms", _unityWatch.Elapsed.Milliseconds);
            _ecsResult   = string.Format("ecs: {0}ms", _ecsWatch.Elapsed.Milliseconds);
        }
Exemple #2
0
        public static void RunLeoEcsBenchmark()
        {
            EcsWorld world = new EcsWorld().AddSystem(new MoveSys());

            for (var i = 0; i < EntitiesCount; i++)
            {
                int e   = world.CreateEntity();
                Pos pos = world.AddComponent <Pos>(e);
                pos.Location = new Vector3(1f, 2f, 0f);
                pos.Rotation = 0;
                Vel vel = world.AddComponent <Vel>(e);
                vel.Linear  = new Vector3(2f, 2f, 1f);
                vel.Angular = 0.01f;
            }
            //warmup
            world.RunUpdate();

            Measure("Leopotam", () => {
                for (var i = 0; i < RepeatCount; i++)
                {
                    world.RunUpdate();
                }
            });
        }
Exemple #3
0
 void Update()
 {
     _world.RunUpdate();
 }