using System; using UnityEngine; using UnityEngine.UI; using System.Collections; namespace vnxbqy.UI { public class BugWin : Window { [SerializeField] InputField inputTitle; [SerializeField] InputField inputContent; [SerializeField] Button putBtn; float coolTime = 0f; protected override void BindController() { } protected override void AddListeners() { putBtn.AddListener(ClickPutBtn); } protected override void OnPreOpen() { inputTitle.text = ""; inputContent.text = ""; } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } private void ClickPutBtn() { string title = inputTitle.text; string content = inputContent.text; if (string.IsNullOrEmpty(title)) { ServerTipDetails.DisplayNormalTip(Language.Get("BugSubmit101")); return; } if (string.IsNullOrEmpty(content)) { ServerTipDetails.DisplayNormalTip(Language.Get("BugSubmit102")); return; } ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("BugSubmit103"), (bool isOk) => { if (isOk) { if (coolTime <= 0) { OperationLogCollect.Instance.BugReport(title, content); SysNotifyMgr.Instance.ShowTip("BUGSubmit"); coolTime = 60; StartCoroutine(SubmitCoolTime()); } else { SysNotifyMgr.Instance.ShowTip("BUGSubmitCoolTime"); } } }); } IEnumerator SubmitCoolTime() { while (true) { coolTime -= 1; if (coolTime <= 0) { break; } yield return new WaitForSeconds(1); } } } }