| | |
| | | using System; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections; |
| | | |
| | | namespace Snxxz.UI |
| | | { |
| | | public class SetUp_BugWin : MonoBehaviour |
| | | { |
| | | [SerializeField] InputField inputTitle; |
| | | [SerializeField] InputField inputContent; |
| | | [SerializeField] Button putBtn; |
| | | float coolTime = 0f; |
| | | |
| | | private void Awake() |
| | | { |
| | | putBtn.AddListener(ClickPutBtn); |
| | | } |
| | | |
| | | private void OnEnable() |
| | | { |
| | | inputTitle.text = ""; |
| | | inputContent.text = ""; |
| | | } |
| | | |
| | | private void ClickPutBtn() |
| | | { |
| | | string title = inputTitle.text; |
| | | string content = inputContent.text; |
| | | |
| | | if (string.IsNullOrEmpty(title)) |
| | | { |
| | | MessageWin.Inst.ShowFixedTip(Language.Get("BugSubmit101")); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(content)) |
| | | { |
| | | MessageWin.Inst.ShowFixedTip(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); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class SetUp_BugWin : MonoBehaviour
|
| | | {
|
| | | [SerializeField] InputField inputTitle;
|
| | | [SerializeField] InputField inputContent;
|
| | | [SerializeField] Button putBtn;
|
| | | float coolTime = 0f;
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | putBtn.AddListener(ClickPutBtn);
|
| | | }
|
| | |
|
| | | private void OnEnable()
|
| | | {
|
| | | inputTitle.text = "";
|
| | | inputContent.text = "";
|
| | | }
|
| | |
|
| | | 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);
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | | }
|