private void OnDestroy() { Debug.Log("[Arena] OnDestroy"); OnConnected -= ReadyReConnect; UnsubsribeEvents(); Disconnect(); Instance = null; }
void initAnszuClient() { if (!PTK.Ansuz.Ansuzinitialized) { ansuzClient = gameObject.AddComponent <PTK.Ansuz>(); ansuzClient.OnConnected += arenaConnected; ansuzClient.OnDisconnected += arenaDisonnected; } }
public ArenaReceiver(Ansuz instance, string subscribeTopic, int requestID) { ansuz = instance; topic = subscribeTopic; arenaID = instance.ArenaID; uid = instance.UID; ownRequestID = requestID; ///instance.RegisterReceiver(subscribeTopic, this); }
public void Init() { if (Instance != null) { enabled = false; DestroyImmediate(this); return; } Instance = this; GetDeviceToken(); string defaultTopic = "arena/" + DeviceID; _qosMap[defaultTopic] = MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE; Ansuzinitialized = true; }
public AnsuzTask(Ansuz instance, AnsuzRequest request) { ansuz = instance; _requestJson = JsonUtility.ToJson(request); }