private void OnMessageReceived(WebSocket webSocket, string message) { RKLog.Log("OnMessageReceived: " + message, "socketcontroller"); SocketResponse data = JsonUtility.FromJson <SocketResponse>(message); GenericData gd = new GenericData(); foreach (ResponseStringList item in data.data) { gd.Set(item.key, item.value); } RKLog.Log("invoke: " + gd.ToString(), "socketcontroller"); MessageReceived.Invoke(data.type, gd); if (data.type == "update") { RKLog.Log("onmessagereceived, update: " + gd.ToString() + " dus poll", "socketcontroller"); } }