void Start() { quitButton.onClick.AddListener(() => { SoundUtilty.PlayResouceSound("Sound/Tips"); MessageBox.Show("信息提示", "确定要退出系统吗?", MessageBoxButtonState.OK, (ok) => { Application.Quit(); }, true); }); backButton.onClick.AddListener(() => { string currentScene = PlayerPrefs.GetString("currrentScene"); if (string.Compare(currentScene, "Game") == 0 || string.Compare(currentScene, "ScoreOrder") == 0) { SceneTools.instance.BackScene(); } else { SceneTools.instance.LoadScene("Login"); LoingStateReset(); } }); userText.text = ""; backButton.gameObject.SetActive(false); }
public void ShowMessage(string errrorMessage, SoundType soundType) { CodeField.text = ""; message.text = errrorMessage; DOVirtual.DelayedCall(3.0f, () => { message.text = ""; }); if (soundType != SoundType.None) { SoundUtilty.PlayResouceSound("Sound/" + soundType.ToString()); } }
public void ShowMessage(string text, SoundType soundType, float time = 3.0f) { GetComponentInChildren <Text>().text = text; DOVirtual.DelayedCall(time, () => { GetComponentInChildren <Text>().text = ""; }); if (soundType != SoundType.None) { SoundUtilty.PlayResouceSound("Sound/" + soundType.ToString()); } }
public void ShowLoginError(string error, SoundType soundType) { userName.text = ""; passwrod.text = ""; LoginerrorMessage.text = error; DOVirtual.DelayedCall(3.0f, () => { LoginerrorMessage.text = ""; }); LoginButton.interactable = true; if (soundType != SoundType.None) { SoundUtilty.PlayResouceSound("Sound/" + soundType.ToString()); } }
private IEnumerator CheckEnterState() { while (true) { RestFulProxy.CheckEnterButton((result) => { result = result.Trim('"'); if (result.Equals("0")) { GetComponent <Button>().interactable = true; SoundUtilty.PlayResouceSound("Sound/GameStart"); //SetAddLifeButton(); StopAllCoroutines(); } }); yield return(new WaitForSeconds(4.0f)); } }