Ejemplo n.º 1
0
        public void Setup()
        {
            Add(_stack = new ScreenStack
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Both,
                Size             = new Vector2(0.8f),
            });

            if (!File.Exists(path))
            {
                _ = new DefaultFolder();
            }

            for (int i = 0; i < 4; i++)
            {
                Enum.TryParse(gameini.Get <string>((SettingsConfig)i), out Key key);
                keys[i] = key;
            }

            AddStep("GameplayScreen", AddGameplayScreen);
            AddStep("AddRemoveGameplayScreen", AddRemoveGameplayScreen);
            AddStep("Fail", Fail);
            AddStep("Remove GameplayScreen", () =>
            {
                _gameplayScreen?.track?.Stop();
                _gameplayScreen?.Expire();
            });
        }
Ejemplo n.º 2
0
        private async void AddRemoveGameplayScreen()
        {
            for (var i = 0; i < Iterations; i++)
            {
                if (IsDisposed)
                {
                    break;
                }

                await LoadComponentAsync(_gameplayScreen = new GameplayScreen(path, mods)
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                    Size             = new Vector2(1f),
                }, _stack.Push);

                await Task.Delay(2500);

                _gameplayScreen.Expire();
            }
        }