void Start() { udpReceiver = this.gameObject.GetComponent <UDPReceiver>(); udpReceiver.OnReceived = OnJsonReceived; Debug.LogWarning(string.Format("RemotePrefs :: receive json port is [:{0}].", udpReceiver.port) + " send json like this {\"command\": \"set\", \"key\": \"SAMPLE\", \"value_type\": \"int\", \"int_value\": 123}"); }
void OnDisable() { udpReceiver.OnReceived = null; udpReceiver.Close(); udpReceiver = null; }