Example #1
0
    public void Stop(bool destroy = true)
    {
        if (_thread != null)
        {
            _threadStop = true;
            _thread.Join();
            _thread     = null;
            _threadStop = false;
        }
        if (useDLL)
        {
            udp_close();
        }
        else
        {
            if (udpClient != null)
            {
                udpClient.Close();
                udpClient = null;
            }
        }

        if (destroy)
        {
            if (instance != null)
            {
                instance = null;
                Destroy(gameObject);
            }
        }
    }
Example #2
0
 void Awake()
 {
     instance = this;
 }