public void SendPosition(Vector3 pos, Vector3 vel) { if (ClientConnected) { client.SendPosition(pos, vel); } }
void Update() { if (StartClient) { client = new ClientMVP(ip, port, userId); t = new Thread(new ThreadStart(client.Run)); t.Start(); StartClient = false; } if (StopClient) { client.stopRunning = true; StopClient = false; } if (StopThread) { t.Abort(); StopThread = false; } if (SendPosition) { client.SendPosition(toBeSentPosition, Vector3.zero); SendPosition = false; } }