示例#1
0
        public async Task InitializeAsync()
        {
            using (var session = _performanceProfiler.CreateSession())
            {
                _scene.FpsChanged += SceneOnFpsChanged;
                var sceneContainer = await _scenePersistenceService.LoadScene2DAsync();

                if (sceneContainer == null)
                {
                    var triangle = new Triangle2D(
                        new Vector2D(-50, -50),
                        new Vector2D(0, 50),
                        new Vector2D(50, -50),
                        GetNextColor());

                    _scene.Append(triangle);
                    await _scene.BeginShiftAsync(0, 0);

                    await _scene.EndShiftAsync(_width / 2, _height / 2);

                    return;
                }

                _scene.FromScene2Ds(sceneContainer);
                await _scene.RenderAsync();

                session.LogWithPerformance("2D scene loaded");
            }
        }
        public async Task InitializeAsync()
        {
            using (var session = _performanceProfiler.CreateSession())
            {
                await RestoreAppearanceAsync();

                LogConsole.Initialize();
                session.LogWithPerformance("Application started");
            }
        }