예제 #1
0
    // Recreate game with all hats based on game phase.
    // Each case's code is what happens before changing to next phase
    public void ChangeGameHat()
    {
        switch (gamePhase)
        {
        // Tutorial
        case 0:
            shopIconButton.SetActive(true);
            shopSign.SetActive(true);
            gamePhase++;
            break;

        // Black hat
        case 1:
            animator.runtimeAnimatorController = animHat;
            playerSprite.sprite      = standHat;
            groundSprite.sprite      = groundHat;
            shopMenuTexture.texture  = shopMenuHat;
            errorMenuTexture.texture = errorMenuHat;
            yayTexture.texture       = yayMenu;
            priceImage.sprite        = price2;
            shopIconTexture.texture  = shopHat;
            gameManager.HatCost      = invisHatCost;
            gamePhase++;
            break;

        // Invis hat
        case 2:
            animator.runtimeAnimatorController = player;
            playerSprite.sprite      = stand;
            groundSprite.sprite      = ground;
            shopMenuTexture.texture  = shopMenu1;
            errorMenuTexture.texture = error1;
            yayTexture.texture       = yayHat;
            priceImage.sprite        = price3;
            shopIconTexture.texture  = shop;
            gameManager.HatCost      = blackHat2Cost;
            gamePhase++;
            break;

        // Black hat
        case 3:
            yayTexture.texture = error2;
            priceImage.sprite  = price4;
            animator.runtimeAnimatorController = player1;
            gameManager.SetJumpReward(jumpReward2);
            gameManager.SetFallReward(fallReward2);
            spawnManager.ChangeJumpIcon();
            spawnManager.ChangeFallIcon();
            closeShopButton.SetActive(false);
            gamePhase++;
            break;

        // Troll mode
        case 4:
            yayTexture.texture = error1;
            gamePhase++;
            break;

        // Player reaches 5kgold troll mode
        case 5:
            errorMenuTexture.texture           = errorD;
            tutorialMenu.texture               = wowNewShop;
            animator.runtimeAnimatorController = player;
            errorMenuObject.SetActive(true);
            shopMenuObject.SetActive(false);
            gameManager.MenuOpen    = true;
            shopMenuTexture.texture = negShopMenu1;
            closeShopButton.SetActive(true);
            priceImage.sprite   = price5;
            gameManager.HatCost = happinessCost;
            gamePhase++;
            break;

        // Negative mode
        case 6:
            groundSprite.sprite     = groundHappy;
            yayTexture.texture      = yayHappy;
            shopMenuTexture.texture = negShopMenu2;
            gameManager.HatCost     = mysteryDogCost;
            priceImage.sprite       = price6;
            gamePhase++;
            break;

        // Happiness
        case 7:
            shopMenuTexture.texture = negShopMenu3;
            priceImage.sprite       = price7;
            gameManager.HatCost     = snowmanCost;
            StartCoroutine(MMMode(mmWaitTime));
            gamePhase++;
            break;

        // Scam
        case 8:
            snowman.SetActive(true);
            shopMenuTexture.texture  = negShopMenu4;
            errorMenuTexture.texture = errorRich;
            priceImage.sprite        = price8;
            yayTexture.texture       = yaySnow;
            gameManager.HatCost      = moonCost;
            gamePhase++;
            break;

        // Snowman
        case 9:
            moon.SetActive(true);
            spawnManager.SpawnJumpStonk();
            yayTexture.texture      = yayMoon;
            shopMenuTexture.texture = shopMenuEnd;
            priceObject.SetActive(false);
            buyButtonObject.SetActive(false);
            gamePhase++;
            break;

        // Moon
        case 10:
            snowmanSprite.sprite = snowmanHat1;
            moonSprite.sprite    = moon1;
            groundSprite.sprite  = groundHappy1;
            gameManager.SetJumpReward(jumpReward3);
            gameManager.SetFallReward(fallReward3);
            spawnManager.ChangeJumpIcon();
            spawnManager.ChangeFallIcon();
            errorMenuTexture.texture = errorMoon;
            errorMenuObject.SetActive(true);
            gameManager.MenuOpen = true;
            shopMenuObject.SetActive(false);
            gamePhase++;
            break;

        case 11:
            gamePhase++;
            break;

        // ENDING!
        default: break;
        }
    }