コード例 #1
0
 void Start()
 {
     playerScript = player.GetComponent <Player>();
     health       = playerScript.health;
     pauseMenu    = pauseMenuPanel.GetComponent <PauseMenuManager>();
     pauseMenu.Hide();
     gameOver = gameOverPanel.GetComponent <GameOverManager>();
     gameOver.Hide();
     BossHealthObject.SetActive(false);
     for (int i = 0; i < Slot1Stars.Length; i++)
     {
         Slot1Stars[i].enabled = false;
         Slot2Stars[i].enabled = false;
     }
     if (arenaMode)
     {
         waveNumberText.enabled = true;
         waveMaster             = GameObject.Find("WaveMaster").GetComponent <WaveMaster>();
     }
     else
     {
         waveNumberText.enabled = false;
     }
     betweenWaveText.enabled = false;
     arenaTrikeHealthObject.SetActive(false);
     arenaTrexHealthObject.SetActive(false);
     Slot1Image.preserveAspect  = true;
     Slot2Image.preserveAspect  = true;
     PistolImage.preserveAspect = true;
 }
コード例 #2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            // If user presses ESC, show the pause menu
            if (pause == false)
            {
                pauseMenu.ShowPause();
                pause = true;
            }
            else
            {
                pauseMenu.Hide();
                pause = false;
            }
        }

        if (player == null)
        {
            SceneManager.LoadScene(sceneName);
        }

        // If the player presses the p key, restart the level
        if (Input.GetButtonDown("Restart"))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
    }
コード例 #3
0
    private void Start()
    {
        game = GameObject.FindGameObjectWithTag("LM").GetComponent <LevelMaster>();



        // Initialise the reference to the script object, which is a
        // component of the pause menu panel game object
        pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>();
        pauseMenu.Hide();
    }
コード例 #4
0
ファイル: UIManager.cs プロジェクト: Thorqs/Alchemaster
 // Use this for initialization
 void Start()
 {
     pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>();
     pauseMenu.Hide();
 }
コード例 #5
0
    // initialization of the scene
    void Start()
    {
        levelMusic   = GetComponent <AudioSource>();
        currentScene = SceneManager.GetActiveScene();
        sceneName    = currentScene.name;

        // Initialise the reference to the script object, which is a
        // component of the pause menu panel game object
        pauseMenu = pauseMenuPanel.GetComponent <PauseMenuManager>();
        //pauseMenu = gameManager.pauseMenuPanel.GetComponent<PauseMenuManager>();
        pauseMenu.Hide();

        if (Total.total.prisoner1 == false)
        {
            prisoner1 = 0;
        }
        else
        {
            prisoner1 = 1;
        }
        PlayerPrefs.SetInt("Prisoner1", prisoner1);

        if (Total.total.prisoner2 == false)
        {
            prisoner2 = 0;
        }
        else
        {
            prisoner2 = 1;
        }
        PlayerPrefs.SetInt("Prisoner2", prisoner2);

        if (Total.total.prisoner3 == false)
        {
            prisoner3 = 0;
        }
        else
        {
            prisoner3 = 1;
        }
        PlayerPrefs.SetInt("Prisoner3", prisoner3);

        if (Total.total.prisoner4 == false)
        {
            prisoner4 = 0;
        }
        else
        {
            prisoner4 = 1;
        }
        PlayerPrefs.SetInt("Prisoner4", prisoner4);

        if (Total.total.prisoner5 == false)
        {
            prisoner5 = 0;
        }
        else
        {
            prisoner5 = 1;
        }
        PlayerPrefs.SetInt("Prisoner5", prisoner5);

        PlayerPrefs.SetInt("Level", 0);
        if (sceneName == "L1-1")
        {
            PlayerPrefs.SetInt("Level", 1);
        }
        else if (sceneName == "L2-1")
        {
            PlayerPrefs.SetInt("Level", 2);
        }
        else if (sceneName == "L2-2")
        {
            PlayerPrefs.SetInt("Level", 3);
        }
        else if (sceneName == "L3-1")
        {
            PlayerPrefs.SetInt("Level", 4);
        }
        else if (sceneName == "L4-1")
        {
            PlayerPrefs.SetInt("Level", 5);
        }
        else if (sceneName == "L5-1")
        {
            PlayerPrefs.SetInt("Level", 6);
        }
    }