Ejemplo n.º 1
0
    private void Awake()
    {
        instance    = this;
        canvas      = GameObject.FindGameObjectWithTag("Canvas").transform;
        eventSystem = GameObject.FindGameObjectWithTag("GameController").GetComponent <EventSystem>();

        controlSchemeScreen = GetComponentInChildren <ControlSchemeScreen>();
        titleScreen         = GetComponentInChildren <TitleScreen>();
        settingsMenu        = transform.parent.GetComponentInChildren <SettingsMenu>();
        sceneSelectMenu     = GetComponentInChildren <SceneSelectMenu>();

        // Set up the Player, Canvas, and EventSystem to persist between scenes
        //DontDestroyOnLoad(Player.PlayerInstance);
        DontDestroyOnLoad(transform.parent.gameObject);
        DontDestroyOnLoad(GameObject.FindGameObjectWithTag("GameController"));
    }
Ejemplo n.º 2
0
    private void Start()
    {
        titleScreenBG   = transform.parent.GetComponent <Image>();
        settingsMenu    = transform.parent.parent.GetComponentInChildren <SettingsMenu>();
        sceneSelectMenu = transform.parent.GetComponentInChildren <SceneSelectMenu>();

        Button[] buttons = GetComponentsInChildren <Button>();
        playButton     = buttons[0];
        settingsButton = buttons[1];
        quitButton     = buttons[2];

        playButton.onClick.AddListener(OnClickedPlay);
        settingsButton.onClick.AddListener(OnClickedSettings);
        quitButton.onClick.AddListener(OnClickedQuit);

        // Set up the Player, Canvas, and EventSystem to persist between scenes
        DontDestroyOnLoad(GameObject.FindGameObjectWithTag("Player"));
        DontDestroyOnLoad(transform.parent.parent.gameObject);
        DontDestroyOnLoad(GameObject.FindGameObjectWithTag("GameController"));
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        settingsMenu    = transform.parent.GetComponentInChildren <SettingsMenu>();
        sceneSelectMenu = transform.parent.GetComponentInChildren <SceneSelectMenu>();
        mainMenu        = transform.parent.GetComponentInChildren <MainMenu>();

        Button[] buttons = GetComponentsInChildren <Button>();
        unpauseButton  = buttons[0];
        settingsButton = buttons[1];
        resetButton    = buttons[2];
        quitButton     = buttons[3];

        unpauseButton.onClick.AddListener(ClickUnpause);
        settingsButton.onClick.AddListener(ClickSettings);
        resetButton.onClick.AddListener(ClickReset);
        quitButton.onClick.AddListener(ClickQuit);

        pauseMenu = gameObject;
        gameObject.SetActive(false);
        IsPaused = false;
    }
Ejemplo n.º 4
0
 private void ClickReturn()
 {
     SceneSelectMenu.LoadScene(SceneSelectMenu.sceneTitleScreen);
     gameObject.SetActive(false);
     MainMenu.OpenSceneSelectMenu();
 }
Ejemplo n.º 5
0
 private void ClickQuit()
 {
     CameraController.UnlockCamera();
     SceneSelectMenu.LoadScene(SceneSelectMenu.sceneTitleScreen);
 }
Ejemplo n.º 6
0
 private void ClickReset()
 {
     SceneSelectMenu.ReloadScene();
 }
Ejemplo n.º 7
0
    private IEnumerator ResetSim()
    {
        yield return(new WaitForSeconds(ResetTime));

        SceneSelectMenu.ReloadScene();
    }