using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class emailcheck : MonoBehaviour { public void cloud() { if (_P.SaveCloudEmail) { CheckEmail(this.gameObject); } else { btnok(true); } CheckCarSp(this.gameObject); } public void local() { if (_P.SaveLocalEmail) { CheckEmail(this.gameObject); } else { btnok(true); } CheckCarSp(this.gameObject); } public static void CheckEmail(GameObject THIS) { btnok(false); string emailAddress = THIS.gameObject.GetComponent().text; if (emailAddress.IndexOf('@') > 0 && emailAddress.IndexOf('.') > 0 && emailAddress.IndexOf(' ') == -1) { btnok(true); } THIS.gameObject.GetComponent().text = THIS.gameObject.GetComponent().text.ToLower(); } public static void btnok(bool TF) { if (Get.o2("PNL/SAVEWEBpnl", "ButtonOK") != null) { Set.alpha(Get.o1("PNL/SAVEWEBpnl/ButtonOK"), TF); } if (Get.o2("PNL/SAVEpnl", "ButtonOK") != null) { Set.alpha(Get.o1("PNL/SAVEpnl/ButtonOK"), TF); } if (Get.o2("PNL/SAVEpnl", "ButtonOK-Mobile") != null) { Set.alpha(Get.o1("PNL/SAVEpnl/ButtonOK-Mobile"), TF); } } public void CheckCarSp(GameObject THIS) { string name = THIS.gameObject.GetComponent().text; name = name.Replace("&", "").Replace("?", "").Replace("%", "").Replace("$", "").Replace("#", ""); THIS.gameObject.GetComponent().text = THIS.gameObject.GetComponent().text = name; } public static bool ok(string emailAddress) { bool ok = false; if (emailAddress.IndexOf('@') > 0 && emailAddress.IndexOf('.') > 0 && emailAddress.IndexOf(' ') == -1) { ok = true; } return ok; } }