public void Compile() { string[] code = inputField.text.Split('\n'); Debug.Log(code); string errorCode = ""; int lineNumber = 0; bool errorCheckFailed = ErrorCheck(code, out errorCode, out lineNumber); Debug.Log("Error: " + errorCheckFailed); if (!errorCheckFailed) { } else { } FindObjectOfType <Player>().Sleeping = false; FindObjectOfType <Player>().dayCode = code; FindObjectOfType <Player>().currentLine = 0; FindObjectOfType <Player>().execute(); inputField.DeactivateInputField(); FindObjectOfType <InventoryManager>().startTime = Time.time; FindObjectOfType <InventoryManager>().dayProgress = 0; Debug.Log("reeeeeched End"); }
static int DeactivateInputField(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); TMPro.TMP_InputField obj = (TMPro.TMP_InputField)ToLua.CheckObject(L, 1, typeof(TMPro.TMP_InputField)); obj.DeactivateInputField(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
Regex m_EmptyMessageRegex = new Regex(@"^/(\w+)\s+$"); // match 'empty' messages like e.g. "/all " void OnEndEdit(string value) { if (!Input.GetKey(KeyCode.Return) && !Input.GetKey(KeyCode.KeypadEnter)) { return; } field.DeactivateInputField(); field.text = defaultPrefix; m_MoveToEnd = true; if (string.IsNullOrEmpty(value) || m_EmptyMessageRegex.IsMatch(value)) { return; } m_ChatLinesToSend.Add(value); }