示例#1
0
        //TODO: Weird heap corruption bug happens sometimes. -1073740940
        static void Main(string[] args)
        {
            CoreEngine.Initialize();
            CoreEngine.targetFps = 0;

            Asset.LoadAssetPackage("data/assets.dat");

            //Physics.Settings.Gravity = Vector3.Zero;

            InitializeWorld();

            Profiler.ProfilingEnabled = true;

            Physics.Settings.Gravity = Vector3.Zero;
            Physics.Settings.solverIterationCount = 2;

            CoreEngine.Update += delegate
            {
                if (CoreEngine.FrameNumber == 500)
                {
                    Profiler.WriteToFile(@"D:\ecs_profile_speedscope.json", ProfilingFormat.SpeedScope, FrameSelection.Shortest);
                    Profiler.WriteToFile(@"D:\ecs_profile_chrometracing_95.json", ProfilingFormat.ChromeTracing, FrameSelection.Percentile95);
                    Profiler.WriteToFile(@"D:\ecs_profile_chrometracing_median.json", ProfilingFormat.ChromeTracing, FrameSelection.Median);
                    Profiler.WriteToFile(@"D:\ecs_profile_chrometracing_shortest.json", ProfilingFormat.ChromeTracing, FrameSelection.Shortest);
                }
            };

            CoreEngine.Run();
        }