public setResponse ( string response ) : void | ||
response | string | |
Résultat | void |
void Update() { if (queue.notEmpty()) { CallResponse call = queue.remove(); try{ //Debug.Log("Trying to eval '" + call.getCall() + "'"); if (call.getCall().Equals("\n")) { call.setResponse(""); } else { if (!call.getCall().StartsWith("util.")) { TraceLogger.LogTrace(call.getCall()); } object ret = Eval.eval(call.getCall(), ObjectManager.GetObjects(), new Util()); string response = ""; if (ret != null) { response = ret.ToString(); } //Debug.Log("Response was " + response); call.setResponse(response); } call.respond(); } catch (Exception e) { Debug.Log(e.Message); Debug.Log(e.StackTrace); call.setResponse("Error: " + e.ToString().Replace("\n", "")); TraceLogger.LogError(call.getResponse()); call.respond(); } } }
void Update() { while (queue.notEmpty()) { CallResponse call = queue.remove(); try{ Debug.Log("Trying to eval '" + call.getCall() + "'"); if (call.getCall().Equals("\n")) { call.setResponse(""); } else { string response = Eval.eval(call.getCall()).ToString(); call.setResponse(response); } call.respond(); } catch (Exception e) { call.setResponse("Error: " + e.ToString().Replace("\n", "")); } } }