Example #1
0
        public void ProcessFixedUpdate(Scene scene)
        {
            if (GlobalGameState.CurrentPhase == GlobalGameState.Phase.GameOver)
            {
                if (_updatesCounter == 0)
                {
                    scene.AddEntity(_entityFactory.CreateGameOverVfx());
                }

                _updatesCounter++;

                if (_updatesCounter > 10)
                {
                    var gameOver = scene.RootEntities.Single(e => e.Name == "GameOver");
                    gameOver.GetComponent <SpriteRendererComponent>().Visible = true;
                }

                var bird = scene.RootEntities.Single(e => e.Name == "Bird");
                if (bird.GetComponent <InputComponent>().GetActionState("Flap") && _updatesCounter > 30)
                {
                    GlobalGameState.IsRetry = true;
                    _sceneManager.LoadScene(@"Assets\Level\Empty.scene");
                }
            }
            else
            {
                _updatesCounter = 0;
            }
        }