コード例 #1
0
ファイル: GameController.cs プロジェクト: haffez23/SnakeColor
    public void SetGameover()
    {
        gameState = GameState.GAMEOVER;
        DisableCG(Menu_CG);
        DisableCG(GAME_CG);
        EnableCG(GAMEOVER_CG);
        SM.SetInitialAmount(4);
        SCORE = 0;



        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Bar"))
        {
            Destroy(g);
        }

        foreach (GameObject g in GameObject.FindGameObjectsWithTag("SimpleBox"))
        {
            Destroy(g);
        }

        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Snake"))
        {
            Destroy(g);
        }

        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Food"))
        {
            Destroy(g);
        }
        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Box"))
        {
            Destroy(g);
        }

        SM.SpawnBodyPart();
        BM.SetPreviousPosAfterGameOver();

        speedAdded = false;
        SM.speed   = 3;
        PlayerPrefs.SetInt("BESTSCORE", BESTSCORE);
        BM.SimpleBoxPosition.Clear();
    }