Esempio n. 1
0
    void Start()
    {
        //UI MAY LOOK WEIRD IN UNITY PREVIEW WINDOW
        //SET UP TO LOOK NICE IN ACTUAL GAME WINDOW
        //Set up title
        title =  GameObject.Find("Title").GetComponent<GUIText>();
        title.transform.position = new Vector3(0.5f,0.9f,0f);
        title.fontSize = 50;

        //UserName Label on the screen
        UNLabel =  GameObject.Find("UNLabel").GetComponent<GUIText>();
        UNLabel.transform.position = new Vector3(0.5f,0.63f,0f);

        //Password Label on the screen
        PWLabel =  GameObject.Find("PWLabel").GetComponent<GUIText>();
        PWLabel.transform.position = new Vector3(0.5f,0.570f,0f);

        //Initialize pw and user name to avoid null pointer
        password = userName = "******";

        errMsg = "";

        //connect to the server when they open up a game client
        net = gameObject.AddComponent<myNetwork>();
        net.Connect();
    }