Unity3d---> IEnumerator
2013-04-18 10:24 2162人阅读 评论(0) 收藏 举报
[csharp] view plaincopy
- using UnityEngine;
- using System.Collections;
- public class Test : MonoBehaviour
- {
- IEnumerator Start ()
- {
- yield return StartCoroutine(login());
- Debug.Log("CCCCCCCCCCCCC");
- Destroy(this.gameObject);
- }
- IEnumerator login ()
- {
- Debug.Log("AAAAAAAAAAAAAAAAA");
- yield return new WaitForSeconds(0);
- Debug.Log("BBBBBBBBBBBBBBBBB");
- }
- }
------print--------
AAAAAAAAAAA
BBBBBBBBBBB
CCCCCCCCCCC
--------------------
[csharp] view plaincopy
- using UnityEngine;
- using System.Collections;
- public class Test : MonoBehaviour
- {
- void Start ()
- {
- StartCoroutine(login());
- Debug.Log("CCCCCCCCCCCCC");
- Destroy(this.gameObject);
- }
- IEnumerator login ()
- {
- Debug.Log("AAAAAAAAAAAAAAAAA");
- yield return new WaitForSeconds(0);
- Debug.Log("BBBBBBBBBBBBBBBBB");
- }
- }
------print--------
AAAAAAAAAAA
CCCCCCCCCCC
时间: 2024-10-21 16:06:09