Exemple #1
0
    /*public int mode;
     * private string IP;
     * private bool loadAble;
     * private gameController gameInfo;
     * //private multiMode multiMode;
     * private int characterID,difficulty;
     * protected int computerNum,playerNum;
     */

    void Start()
    {
        GameObject obj = GameObject.Find("client");

        startPosition = new Vector3(90, 28, 160);

        if (obj != null)
        {
            c = obj.GetComponent <client> ();
            c.setGameInfo(this);
            createCars(c.getPlayerNum(), c.getPlayerID(), MULTIPLAYER);              //multiMode.MULTIPLAYER);
        }
        else
        {
            createCars(1, 0, SINGLEPLAYER);             //multiMode.SINGLEPLAYER);
        }

        //GUI.Label (new Rect (0.5f, 0.5f, 0.8f, 0.8f), "123");
    }
    void Start()
    {
        GameObject obj = GameObject.Find ("client");

        if(obj!=null){
            c = obj.GetComponent<client> ();
            c.setGameInfo (this);
            this.createCars (c.getPlayerNum (), c.getPlayerID (),multiModeUI.MULTIPLAYER);
            c.sendCarReady ();//signal to tell server it is ready
        }
        else{
            this.createCars (1, 0,multiModeUI.SINGLEPLAYER);
        }
        //this.createCars (1, 0);
        //GameObject obj=Instantiate(playerCars,new Vector3(550,-30,550),Quaternion.identity) as GameObject;
    }