private void OnValueChanged(string t) { bool needReInput = false; if (SentiWords == null) { return; } if (!LanguageManager.CurrentLanguageIsChinese()) { return; } if (string.IsNullOrEmpty(t)) { return; } foreach (string ssr in SentiWords) { if (t.Contains(ssr)) { if (!ssr.Equals("")) { needReInput = true; Debug.Log("包含敏感词汇:" + ssr + ",需要进行替换"); //string stt = inputField.text; //int length = ssr.ToCharArray().Length; //string s = ""; //for (int i = 0; i < length; i++) // s += "*"; //Debug.Log(stt.Replace(ssr, s)); //stt = stt.Replace(ssr, s); //inputField.text = stt; break; } } } if (needReInput) { inputField.text = null; if (callBack != null) { callBack(needReInput); } } }