diff options
author | chai <chaifix@163.com> | 2021-05-06 14:51:05 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-05-06 14:51:05 +0800 |
commit | f342c68d13bddf451ab6cd64fc5b13cf65b65c4f (patch) | |
tree | b3457f6c2c9b42017e84a01aef854a4e67586ddc /Assets/Test/08_Button/UI08Button.cs | |
parent | d0e1834bd1972b4262d3e9b46ed55698a7f92025 (diff) | |
parent | 70ee31ea614d248f67f3d98ada5acb981def7e58 (diff) |
Merge branch 'master' of warmcat.org:/home/git-repo/UGUI_LEARN
# Conflicts:
# Assets/Test/08_Button.meta
# Assets/Test/08_Button/08_Button.unity
# Assets/Test/08_Button/08_Button.unity.meta
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); + } + } + +} |