// 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()
        {
            inviteButton.enabled = false;

            GameObject mainMenuWindow = GameObject.Find("MainMenuWindow");

            mainMenuLogic = mainMenuWindow.GetComponent <MainMenuLogic>();
            GameObject loginWindow = GameObject.Find("LoginWindow");

            loginLogic    = loginWindow.GetComponent <LoginLogic>();
            levelAnimator = gameCreationCanvas.GetComponent <Animator>();
            gameCreationCanvas.enabled = false;
            mainMenuButton.onClick.AddListener(MainMenuClick);
            changeLevelButton.onClick.AddListener(ChangeLevelButtonClick);
            playButton.onClick.AddListener(PlayButtonClick);
            inviteButton.onClick.AddListener(InviteButtonClick);
            serverConnection = ServerConnection.getInstance();


            pythonBtn.onClick.AddListener(PythonClick);
            pythonAnimator = pythonCanvas.GetComponent <Animator>();

            matlabBtn.onClick.AddListener(MatlabClick);
            matlabAnimator = matlabCanvas.GetComponent <Animator>();
        }
示例#2
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;
        }
示例#3
0
        // Start is called before the first frame update
        void Start()
        {
            GameObject mainMenuWindow = GameObject.Find("MainMenuWindow");

            mainMenuLogic    = mainMenuWindow.GetComponent <MainMenuLogic>();
            LoginWindow      = GameObject.Find("LoginWindow");
            loginLogic       = LoginWindow.GetComponent <LoginLogic>();
            serverConnection = ServerConnection.getInstance();

            informationCanvas.enabled = false;

            loadEmail.onClick.AddListener(EmailLoadOnClick);
            loadAge.onClick.AddListener(AgeLoadOnClick);
            modifySpam.onClick.AddListener(SpamModifyOnClick);
            mainMenuBtn.onClick.AddListener(MainMenuClick);
        }