|
So I'm almost done with my Space Invaders style game, but I need a way to pause the game when you win (or lose) for a short amount of time, so that the player has time to see the text of "you win" or "you lose" before the application closes through Application.Quit(); Is there any way to do this without setting up some sort of complex timer thing?
(comments are locked)
|
|
I assume you call Application.Quit() from a coroutine... so... I'm doing this in C# not JS so my 'function' is void, and it's giving me an error about not being able to return anything in a void function.
Jul 28 '11 at 12:24 AM
Infamous911
You need to use an IEnumerator instead of a void then. http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html Set it to C#
Jul 28 '11 at 01:03 AM
vxssmatty
Using this code: IEnumerator Awake() { yield return new WaitForSeconds(5.0F); } I'm getting this error: Script error: Awake() can not be a coroutine.
Jul 28 '11 at 03:53 AM
Infamous911
You can not use Awake() to yield. You should this
Jul 28 '11 at 04:50 AM
YikYikHeiHei
This works, thanks!
Jul 28 '11 at 04:10 PM
Infamous911
(comments are locked)
|
|
It can wait and show "you win" or "you lose". UpdateChange to C#But I'm doing this in C# and it is giving me the error: The body of
Jul 28 '11 at 12:31 AM
Infamous911
I have to change this script to C#, please check this. And my script have not OnTriggerEnter(UnityEngine.Collider), which script?
Jul 28 '11 at 01:31 AM
YikYikHeiHei
(comments are locked)
|
