コード例 #1
0
    void Start()
    {
        currentStage = 1;
        gameState    = GameState.InMainMenu;

        uiManager.StartGame += SwitchStateToInGame;

        wormController.NextLevel       -= OnVictory;
        wormController.NoNextLevel     -= OnLosing;
        wormController.EatCenter       -= circleController.StopRotationOfCircle;
        wormController.CompletedEating -= circleController.EatCircle;

        adController.FinishedRewardedAd -= SwitchToStateInGameAfterAds;

        wormController.CompletedEating += circleController.PlayEatenCirle;
        wormController.NextLevel       += OnVictory;
        wormController.NoNextLevel     += OnLosing;
        wormController.EatCenter       += circleController.EatCircle;

        adController.FinishedRewardedAd += SwitchToStateInGameAfterAds;

        adController.RequestInterstitialAd();
        adController.RequestRewardedAd();

        PlayerPrefs.SetString("PlayerScore", currentStage.ToString());
    }