Hi I’m having some problems with my code, I can assure that worked well, but now I jump with coroutines error … Here is the code to see if anyone can help me … I am using Ngui, then when you press a button called one of the coroutines, but now I get the error.
public IEnumerator WaitAlertView()
{
yield return new WaitForSeconds (0.2f);
EtceteraBinding.hideActivityView();
yield return new WaitForSeconds (0.6f);
EtceteraBinding.showAlertWithTitleMessageAndButton("Error","Es posible que el nombre de usuario ya exista, por favor escoge otro nombre","Vale");
}
public IEnumerator WaitAlertView2()
{
yield return new WaitForSeconds (0.2f);
EtceteraBinding.hideActivityView();
yield return new WaitForSeconds (0.6f);
EtceteraBinding.showAlertWithTitleMessageAndButton("Error","Se ha cancelado el registro","Vale");
}
public IEnumerator WaitAlertView3()
{
yield return new WaitForSeconds (0.2f);
EtceteraBinding.hideActivityView();
yield return new WaitForSeconds (0.6f);
EtceteraBinding.showAlertWithTitleMessageAndButton("Error","El Login ha fallado, comprueba que su usuario y password son correctos","Vale");
}
public IEnumerator WaitAlertView4()
{
yield return new WaitForSeconds (0.2f);
EtceteraBinding.hideActivityView();
yield return new WaitForSeconds (0.6f);
cargado = true;
}
// Update is called once per frame
public void Update ()
{
myName = nameuser.text;
myPassword = password.text;
myEmail = email.text;
loginUser2 = loginName.text;
loginPass2 = loginPass.text;
NivelCargado();
}
// Accion que se dispara cuando se pulsa el boton unirse a PLM
public void SendUserToParse()
{
EtceteraBinding.showBezelActivityViewWithLabel("Creando usuario, un momento por favor");
// Crear nuevo usuario en Base de datos
var user = new ParseUser()
{
Username = myName,
Password = myPassword,
Email= myEmail
};
Task signUpTask = user.SignUpAsync().ContinueWith(t =>
{
if (t.IsCanceled)
{
StartCoroutine(WaitAlertView2());
}
else if ( t.IsFaulted)
{
StartCoroutine(WaitAlertView());
}
else
{
StartCoroutine(WaitAlertView4());
}
});
}
// Accion que se dispara cuando se pulsa el boton Login
public void Login()
{
EtceteraBinding.showBezelActivityViewWithLabel("Conectando, un momento por favor");
ParseUser.LogInAsync(loginUser2,loginPass2).ContinueWith(t=>
{
if (t.IsFaulted || t.IsCanceled)
{
StartCoroutine(WaitAlertView3());
}
else
{
StartCoroutine(WaitAlertView4());
}
});
}
// Cuando el login se ha creado con exito cambiamos de escena
public void NivelCargado ()
{
if (cargado)
{
Application.LoadLevel ("EscenadeJuego");
}
}