zoukankan      html  css  js  c++  java
  • Unity3d---> IEnumerator

    Unity3d---> IEnumerator

    [csharp] view plaincopy
     
    1. using UnityEngine;  
    2. using System.Collections;  
    3.   
    4. public class Test : MonoBehaviour   
    5. {  
    6.     IEnumerator Start ()   
    7.     {  
    8.         yield return StartCoroutine(login());  
    9.           
    10.         Debug.Log("CCCCCCCCCCCCC");  
    11.           
    12.         Destroy(this.gameObject);  
    13.     }  
    14.       
    15.     IEnumerator login ()   
    16.     {  
    17.         Debug.Log("AAAAAAAAAAAAAAAAA");  
    18.           
    19.         yield return new WaitForSeconds(0);  
    20.           
    21.         Debug.Log("BBBBBBBBBBBBBBBBB");  
    22.     }  
    23. }  

    ------print--------

    AAAAAAAAAAA

    BBBBBBBBBBB

    CCCCCCCCCCC

    --------------------

    [csharp] view plaincopy
     
    1. using UnityEngine;  
    2. using System.Collections;  
    3.   
    4. public class Test : MonoBehaviour   
    5. {  
    6.     void Start ()   
    7.     {  
    8.         StartCoroutine(login());  
    9.           
    10.         Debug.Log("CCCCCCCCCCCCC");  
    11.           
    12.         Destroy(this.gameObject);  
    13.     }  
    14.       
    15.     IEnumerator login ()   
    16.     {  
    17.         Debug.Log("AAAAAAAAAAAAAAAAA");  
    18.           
    19.         yield return new WaitForSeconds(0);  
    20.           
    21.         Debug.Log("BBBBBBBBBBBBBBBBB");  
    22.     }  
    23. }  


    ------print--------

    AAAAAAAAAAA

    CCCCCCCCCCC

  • 相关阅读:
    字符串与数字相互转换
    CodeForces
    解救迷茫的草滩小王子
    Ubuntu18.0.4 apt换源
    N进制与十进制之间的 转换(整数,小数)
    2019-10-10问题
    千里之行始于足下,付出总会有回报
    git--基本命令篇
    C#-网络请求方法
    爬虫实战-网易云音乐
  • 原文地址:https://www.cnblogs.com/wonderKK/p/3940270.html
Copyright © 2011-2022 走看看