示例#1
0
    //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);
    }
示例#2
0
 public void OnApplicationQuit()
 {
     if (!isLocalPlayer)
     {
         return;
     }
     StopReceivedThread();
     assignPortClassObject = GameObject.FindGameObjectWithTag("ports").GetComponent <AssignPortClass>();
     assignPortClassObject.QuitAssignPortReceiverMethod(port);
     assignPortClassObject.QuitAssignPortTransmitterMethod(portTransmitter);
 }