Exemplo n.º 1
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();
    }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        GameObject gameCreationWindow = GameObject.Find("GameCreationWindow");

        gameCreationLogic        = gameCreationWindow.GetComponent <GameCreationLogic>();
        serverConnection         = ServerConnection.getInstance();
        invitationCanvas.enabled = false;
        joinBtn.onClick.AddListener(joinClick);
        declineBtn.onClick.AddListener(declineClick);

        animator = invitationCanvas.GetComponent <Animator>();
    }
    //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();
    }