//Code transmitter //public void StopTransmitterThread() //{ // if (!isLocalPlayer) // { // return; // } // transmitterUDPObject.StopTransmitterClient(); // if(transmitterThread.IsAlive) // { // transmitterThread.Abort(); // } //} void OnDestroy() { if (!isLocalPlayer) { return; } StopReceivedThread(); assignPortClassObject.QuitAssignPortReceiverMethod(port); assignPortClassObject.QuitAssignPortTransmitterMethod(portTransmitter); }
public void OnApplicationQuit() { if (!isLocalPlayer) { return; } StopReceivedThread(); assignPortClassObject = GameObject.FindGameObjectWithTag("ports").GetComponent <AssignPortClass>(); assignPortClassObject.QuitAssignPortReceiverMethod(port); assignPortClassObject.QuitAssignPortTransmitterMethod(portTransmitter); }