Esempio n. 1
0
        private IEnumerator WaitRequest_Coroutine()
        {
            yield return(StartCoroutine(Request.RequestData_Coroutine(m_FieldUsername.text, m_FieldPassword.text)));

            if (Request.callbackRequest.Equals("error"))
            {
                m_NotificationError.GetComponent <Animator>().Play("Fade Effect");

                yield return(new WaitForSeconds(3f));

                m_WaitLogin.SetActive(false);
                m_ButtonLogin.SetActive(true);
                m_NotificationError.GetComponent <Animator>().Play("Fade Effect Exit");
            }
            else
            {
                m_NotificationSuccess.GetComponent <Animator>().Play("Fade Effect");

                yield return(new WaitForSeconds(2f));

                m_WaitLogin.SetActive(false);

                yield return(new WaitForSeconds(.5f));

                m_NotificationSuccess.GetComponent <Animator>().Play("Fade Effect Exit");
                LoadScene.ChangeToScene("Gameplay");
            }
        }