示例#1
0
 void Awake()
 {
     // Layers
     MenuLayer   = GameObject.Find("MenuLayer");
     InGameLayer = GameObject.Find("InGameLayer");
     PauseLayer  = GameObject.Find("PauseLayer");
     // Buttons
     PlayButton     = GameObject.Find("PlayButton").GetComponent <Button>();
     PauseButton    = GameObject.Find("PauseButton").GetComponent <Button>();
     ResumeButton   = GameObject.Find("ResumeButton").GetComponent <Button>();
     MenuButton     = GameObject.Find("MenuButton").GetComponent <Button>();
     MainMenuButton = GameObject.Find("MainMenuButton").GetComponent <Button>();
     QuitButton     = GameObject.Find("QuitButton").GetComponent <Button>();
     // EndMenu
     MenuLayerEnd      = GameObject.Find("MenuEnd");
     ScoreText         = GameObject.Find("Score");
     Player            = GameObject.FindGameObjectWithTag("Player").GetComponent <T10_PlayerFight>();
     RetryButtonEnd    = GameObject.Find("RetryButton").GetComponent <Button>();
     MainMenuButtonEnd = GameObject.Find("MainMenuButtonEnd").GetComponent <Button>();
     QuitButtonEnd     = GameObject.Find("QuitButtonEnd").GetComponent <Button>();
     // EndListeners
     RetryButtonEnd.onClick.AddListener(MenuGame);
     MainMenuButtonEnd.onClick.AddListener(MainMenuGame);
     QuitButtonEnd.onClick.AddListener(QuitGame);
     // Listeners
     PlayButton.onClick.AddListener(PlayGame);
     PauseButton.onClick.AddListener(PauseResumeGame);
     ResumeButton.onClick.AddListener(PauseResumeGame);
     MenuButton.onClick.AddListener(MenuGame);
     MainMenuButton.onClick.AddListener(MainMenuGame);
     QuitButton.onClick.AddListener(QuitGame);
 }
示例#2
0
    void Awake()
    {
        // Layers
        MenuLayer    = GameObject.Find("MenuLayer");
        InGameLayer  = GameObject.Find("InGameLayer");
        PauseLayer   = GameObject.Find("PauseLayer");
        ControlLayer = GameObject.Find("CONTROLES");
        // Buttons
        PlayButton     = GameObject.Find("PlayButton").GetComponent <Button>();
        PauseButton    = GameObject.Find("PauseButton").GetComponent <Button>();
        ResumeButton   = GameObject.Find("ResumeButton").GetComponent <Button>();
        MenuButton     = GameObject.Find("MenuButton").GetComponent <Button>();
        MainMenuButton = GameObject.Find("MainMenuButton").GetComponent <Button>();
        QuitButton     = GameObject.Find("QuitButton").GetComponent <Button>();

        ControlButton      = GameObject.Find("ControlButton").GetComponent <Button>();
        ControlButtonPause = GameObject.Find("ControlButtonPause").GetComponent <Button>();
        ReturnButton       = GameObject.Find("ReturnButton").GetComponent <Button>();
        // EndMenu
        MenuLayerEnd      = GameObject.Find("MenuEnd");
        ScoreText         = GameObject.Find("Score");
        Player            = GameObject.FindGameObjectWithTag("Player").GetComponent <T10_PlayerFight>();
        RetryButtonEnd    = GameObject.Find("RetryButton").GetComponent <Button>();
        MainMenuButtonEnd = GameObject.Find("MainMenuButtonEnd").GetComponent <Button>();
        QuitButtonEnd     = GameObject.Find("QuitButtonEnd").GetComponent <Button>();
        // EndListeners
        RetryButtonEnd.onClick.AddListener(MenuGame);
        MainMenuButtonEnd.onClick.AddListener(MainMenuGame);
        QuitButtonEnd.onClick.AddListener(QuitGame);
        // Listeners
        PlayButton.onClick.AddListener(PlayGame);
        PauseButton.onClick.AddListener(PauseResumeGame);
        ResumeButton.onClick.AddListener(PauseResumeGame);
        MenuButton.onClick.AddListener(MenuGame);
        MainMenuButton.onClick.AddListener(MainMenuGame);
        QuitButton.onClick.AddListener(QuitGame);

        ControlButton.onClick.AddListener(DisplayControlMenu);
        ControlButtonPause.onClick.AddListener(DisplayControlMenu);
        ReturnButton.onClick.AddListener(HideControlMenu);
        ControlLayer.SetActive(false);
    }