Exemplo n.º 1
0
        // Start is called before the first frame update
        //It gets all the unity objects needed on this script, makes the menu invisible
        //Get an instance of the server connection
        //set the button events
        void Start()
        {
            GameObject informationWindow = GameObject.Find("InformationWindow");

            informationLogic = informationWindow.GetComponent <InformationLogic>();
            GameObject loginWindow = GameObject.Find("LoginWindow");

            loginLogic = loginWindow.GetComponent <LoginLogic>();
            GameObject gameCreationWindow = GameObject.Find("GameCreationWindow");

            gameCreationLogic = gameCreationWindow.GetComponent <GameCreationLogic>();

            GameObject invitationWindow = GameObject.Find("InvitationWindow");

            invitationLogic = invitationWindow.GetComponent <InvitationLogic>();
            GameObject joinAGameWindow = GameObject.Find("JoinAGameWindow");

            joinAGameLogic = joinAGameWindow.GetComponent <JoinAGameLogic>();
            GameObject scoreBoardWindow = GameObject.Find("ScoreboardWindow");

            scoreBoardLogic = scoreBoardWindow.GetComponent <ScoreBoardLogic>();

            serverConnection = ServerConnection.getInstance();
            createGameBtn.onClick.AddListener(CreateGameClick);
            joinGameBtn.onClick.AddListener(JoinGameClick);
            userInfoBtn.onClick.AddListener(UserInfoClick);
            scoreBoardBtn.onClick.AddListener(ScoreBoardClick);


            gameCreationLogic.playButtonCanvas.enabled = false;
            joinAGameLogic.mainCanvas.enabled          = false;
        }
        // Start is called before the first frame update
        //It gets all the unity objects needed on this script, makes the menu invisible
        //Get an instance of the server connection
        //set the button events
        void Start()
        {
            personalBoardCanvas.enabled = false;
            serverConnection            = ServerConnection.getInstance();


            GameObject scoreBoardWindow = GameObject.Find("ScoreboardWindow");

            scoreBoardLogic = scoreBoardWindow.GetComponent <ScoreBoardLogic>();
            scoreBoardButton.onClick.AddListener(ScoreBoardClick);
        }