Пример #1
0
    // Update is called once per frame
    void Update()
    {
        //temp debug code
        if (Input.GetKeyUp(KeyCode.M))
        {
            //set testing flags
            this.left = false;
            testing   = true;
            //spoof an accepted invite for socket 3001 with side left, and testing flag to true
            StartCoroutine(client.Accepted(3001, left, true));

            //assign game flags
            pTable = tableParent.Find("3001");
            if (GameObject.FindGameObjectsWithTag("Client").Length > 0)
            {
                Transform target = pTable.Find("TableCam");
                Camera.main.transform.GetComponent <Camera>().enabled = false;
                target.GetComponent <Camera>().enabled = true;
            }
            //hook up "left" flipper
            pTable                   = tableParent.Find("3001");
            myFlipper                = pTable.Find("PlayerInput").Find("PlayerLeft").Find("ButtonParent").GetChild(0).GetChild(0).GetComponent <FlipperButton>();
            myFlipper.enabled        = true;
            myFlipper.networkMode    = false;
            otherFlipper             = pTable.Find("PlayerInput").Find("PlayerRight").Find("ButtonParent").GetChild(0).GetChild(0).GetComponent <FlipperButton>();
            otherFlipper.enabled     = true;
            otherFlipper.networkMode = true;

            latencyText = pTable.Find("Canvas").Find("Latency").GetComponent <Text>();
            leftText    = pTable.Find("Canvas").Find("Left").GetComponent <Text>();
            ball        = pTable.Find("Ball");
            ballBody    = ball.GetComponent <Rigidbody>();
        }
    }