Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        // Determines which scene is open
        switch (SceneManager.GetActiveScene().name)
        {
        case "Main Menu":
            IsLoadingLevel = false;

            MainMenuPanel.SetActive(true);
            ControlsPanel.SetActive(false);
            CreditsPanel.SetActive(false);
            LoadingPanel.SetActive(false);

            MusicCreditsTitle.SetActive(false);
            MusicCredits.SetActive(false);
            ArtCreditsTitle.SetActive(false);
            ArtCredits.SetActive(false);
            ProgrammingCreditsTitle.SetActive(false);
            ProgrammingCredits.SetActive(false);
            GameDesignCreditsTitle.SetActive(false);
            GameDesignCredits.SetActive(false);

            TutorialIndex = 0;

            break;

        case "Gamefield":
            IsLoadingLevel = false;

            // Holds the amount of time which has elapsed
            Seconds        = 60.0f;
            WaveInProgress = true;
            // Holds the wave of enemies
            Wave = 1;
            // Determines whether the lose conditions of the game has been met
            PlayerHasLost = false;

            Direction = 0;

            InitiateCameras();

            SelectedBarracks = Barracks[0];

            UIBarracksBlocked.SetActive(false);
            UIPrompt.gameObject.SetActive(false);

            Currency   = 1000;
            SpawnGates = GameObject.FindGameObjectsWithTag("Spawn Gate");

            AutoAttack = true;
            break;
        }
    }
Exemplo n.º 2
0
    // Return Buttons

    // Closes all panels other than the Main Menu
    void Return()
    {
        if (ControlsPanel.activeSelf)
        {
            ControlsPanel.SetActive(false);
        }
        if (CreditsPanel.activeSelf)
        {
            CreditsPanel.SetActive(false);
        }

        MainMenuPanel.SetActive(true);
    }
Exemplo n.º 3
0
 // Opens the Controls Panel
 void Controls()
 {
     MainMenuPanel.SetActive(false);
     ControlsPanel.SetActive(true);
 }
Exemplo n.º 4
0
 public void Controls()
 {
     ControlsPanel.SetActive(true);
 }
Exemplo n.º 5
0
 public void Back()
 {
     CreditsPanel.SetActive(false);
     HelpPanel.SetActive(false);
     ControlsPanel.SetActive(false);
 }