示例#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;
        }
示例#2
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject infoLogObject = GameObject.Find("InfoLog");

        infoLogObject.GetComponent <Canvas>().enabled = false;
        infoLogAnimator = infoLogObject.GetComponent <Animator>();


        GameObject loginWindow = GameObject.Find("LoginWindow");

        loginLogic = loginWindow.GetComponent <LoginLogic>();
        GameObject informationWindow = GameObject.Find("InformationWindow");

        informationLogic = informationWindow.GetComponent <InformationLogic>();
        GameObject registerWindow = GameObject.Find("RegisterWindow");

        registerLogin = registerWindow.GetComponent <RegisterLogin>();
        GameObject mainMenuWindow = GameObject.Find("MainMenuWindow");

        mainMenuLogic = mainMenuWindow.GetComponent <MainMenuLogic>();
        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>();
        connectToServer();
    }
    //Start is called before the first frame update
    //It gets all the unity objects needed on this script, makes the infoLog invisible
    //Get an instance of the server connection
    //set the button events
    //Executes the function to connect to the server for the first time
    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        Debug.Log("Loading Message_Parser");

        GameObject infoLogObject = GameObject.Find("InfoLog");

        infoLogObject.GetComponent <Canvas>().enabled = false;
        infoLogAnimator = infoLogObject.GetComponent <Animator>();


        GameObject loginWindow = GameObject.Find("LoginWindow");

        loginLogic = loginWindow.GetComponent <LoginLogic>();
        GameObject informationWindow = GameObject.Find("InformationWindow");

        informationLogic = informationWindow.GetComponent <InformationLogic>();
        GameObject registerWindow = GameObject.Find("RegisterWindow");

        registerLogin = registerWindow.GetComponent <RegisterLogin>();
        GameObject mainMenuWindow = GameObject.Find("MainMenuWindow");

        mainMenuLogic = mainMenuWindow.GetComponent <MainMenuLogic>();
        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>();
        GameObject personalBoardWindow = GameObject.Find("PersonalBoardWindow");

        personalBoardLogic = personalBoardWindow.GetComponent <LoginUI.PersonalBoardLogic>();
        connectToServer();
    }