// Use this for initialization IEnumerator Start() { omicronManager = GetComponent <OmicronManager>(); ws = new WebSocket(new System.Uri("ws://" + sage2Server + ":" + sage2OmicronPort)); yield return(StartCoroutine(ws.Connect())); while (true) { byte[] reply = ws.Recv(); if (reply != null) { omicronManager.AddEvent(omicronConnector.OmicronConnectorClient.ByteArrayToEventData(reply)); } if (ws.error != null) { Debug.LogError("Error: " + ws.error); break; } yield return(0); } ws.Close(); }
public override void onEvent(EventData e) { parent.AddEvent(e); }// onEvent