protected void ProcessMessage(UnityMessage message) { if (message == null) { Debug.Log("Did not recieve valid message from Max!"); return; } if (message is MessagePing) { Debug.Log((message as MessagePing).message); return; } if (message is MessageGeometryUpdate) { GeometryCore.ProcessMessage(message as MessageGeometryUpdate); return; } if (message is MessageError) { Debug.Log("Max encountered an error: " + (message as MessageError).message); return; } Debug.Log("Encountered unknown message type: " + message.GetType().Name); }
protected void ProcessMessage(UnityMessage message) { if (message is MessagePing) { m_pipe.SendMessage(new MessagePing("Hello from Max!")); return; } if (message is MessageGeometryRequest) { m_pipe.SendMessage(new MessageGeometryUpdate(CreateUpdates())); return; } if (message is MessageMaterialRequest) { m_pipe.SendMessage(new MessageMaterials(GetMaterials(message as MessageMaterialRequest))); return; } if (message is MessageMapRequest) { m_pipe.SendMessage(GetMap(message as MessageMapRequest)); return; } var error = "Recieved unsupported message type: " + message.GetType().Name; Log.Add(error); SendError(error); }