diff options
Diffstat (limited to 'Assets/Test/08_Button/UI08Button.cs')
-rw-r--r-- | Assets/Test/08_Button/UI08Button.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Assets/Test/08_Button/UI08Button.cs b/Assets/Test/08_Button/UI08Button.cs new file mode 100644 index 0000000..ec9f992 --- /dev/null +++ b/Assets/Test/08_Button/UI08Button.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using System; +using System.Collections; + + +public class UI08Button : MonoBehaviour +{ + private void Start() + { + StartCoroutine(Speak()); + } + + void Update() + { + } + + IEnumerator Wait5Sec() + { + Debug.Log("Wait for 5 sec"); + yield return new WaitForSeconds(5); + Debug.Log("Wait for 5 sec done"); + } + + IEnumerator Speak() + { + int i = -1; + while (true) + { + Debug.Log("wait 1 sec" + (++i)); + yield return new WaitForSeconds(1); + yield return StartCoroutine(Wait5Sec()); + Debug.Log("wait 2 sec" + (++i)); + yield return new WaitForSeconds(2); + Debug.Log("wait 3 sec" + (++i)); + yield return new WaitForSeconds(3); + } + } + +} |