boubouk50 a écrit :Doc
Yield
L'exemple C# te montre clairement que tu dois avoir une fonction IEnumerator avec un return sur le WaitForSecond()
Ce qui te donne:
Code : Tout sélectionner
public IEnumerator maFonction () {
boule = GameObject.Find("Sphere").GetComponent<Rigidbody>();
boule.AddForce (new Vector3 (0, -80, 0));
yield return new WaitForSeconds(1)
Application.LoadLevel ("scene1");
}
Merci pour ta réponse,
J'avais en effet testé ça, au vu de la doc mais ça ne fonctionne toujours pas...
Voilà le message d'erreur : ArgumentException: method return type is incompatible
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method, Boolean throwOnBindFailure) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Delegate.cs:190)
System.Delegate.CreateDelegate (System.Type type, System.Object firstArgument, System.Reflection.MethodInfo method) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Delegate.cs:276)
UnityEngine.Events.InvokableCall..ctor (System.Object target, System.Reflection.MethodInfo theFunction) (et ça continue...)