public void SendUdpData() { ReceiveData(); if (!arkitPart.activeInHierarchy) { return; } for (int i = 0; i < randomVector.Length; i++) { randomVector[i] = Random.Range(0f, 100.0f); } if (udp == null) { udp = GameObject.FindWithTag("UDP").GetComponent <UDPObj>(); } else { string s = DateTime.Now.ToString("M/d/yyyy") + " " + System.DateTime.Now.ToString("HH:mm:ss") + ":" + System.DateTime.Now.Millisecond + "," + AudioSync.currentSlideIndex + "," + AudioSync.instance.leftTriggerPressed + "," + AudioSync.instance.rightTriggerPressed + "," //+ string.Join(":", myVector.values); + string.Join(":", randomVector); udp.SendData(s); //Debug.Log(s); } }
// start from Unity3d public void Start() { instance = this; DontDestroyOnLoad(gameObject); //init (); }
void Update() { HandBrake(); wheels[0].ConfigureVehicleSubsteps(2000f, 1000, 300); wheels[1].ConfigureVehicleSubsteps(2000f, 1000, 300); wheels[2].ConfigureVehicleSubsteps(2000f, 1000, 300); wheels[3].ConfigureVehicleSubsteps(2000f, 1000, 300); GameObject go = GameObject.Find("GameManager"); UDPObj udpobj = go.GetComponent <UDPObj>(); float InputSignalNum = udpobj.inputNumber; print("move" + InputSignalNum); }