// Update is called once per frame void Update() { if (dataObj != null && dataObj.time > 0) { // Debug.Log("Here"); elapsedTime += Time.deltaTime; time = 0; //&& dataObj.used == false //elapsedTime > dataObj.time && if (dataObj.used == false && dataObj.positionX != transform.position.x && dataObj.positionY != transform.position.z) { dataObj.used = true; pos.Set(SCALE * dataObj.positionX - offset.x, 0, SCALE * dataObj.positionY - offset.z); time = dataObj.time; rotation = Math.Abs(dataObj.orientation) * ((float)(180f / Math.PI)) % 360; transform.position = pos; transform.rotation = Quaternion.Euler(0, rotation, 0); m.Set(pos.x + transform.position.x / 2, pos.y + transform.position.y / 2, pos.z + transform.position.z / 2); didCollide = Physics.CheckBox(m, s); Debug.Log("vel " + rb.velocity); rb.velocity = oldVel; } } else { //dataObj = GameObject.FindGameObjectWithTag("udpvision").GetComponent<UDPVisionReceive>().getDataObj(0); Debug.Log("non " + rb.velocity); oldVel = rb.velocity; } UDPVisionReceive.decodeDatagram(); }
// Use this for initialization void Start() { start = GameObject.Find("StartLine").GetComponent <Transform>(); rec = GameObject.FindGameObjectWithTag("udpvision").GetComponent <UDPVisionReceive>(); }
// Use this for initialization void Start() { start = GameObject.Find("StartLine").GetComponent<Transform>(); rec = GameObject.FindGameObjectWithTag("udpvision").GetComponent<UDPVisionReceive>(); }