IEnumeratorCurrentTest.csUnity記事: 目次
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
using System.Collections; using System.Collections; using UnityEngine; /// <summary> /// /// Unity 2018.3.0f2 /// /// </summary> public class IEnumeratorCurrentTest : MonoBehaviour { // Use this for initialization private IEnumerator Start() { int hoge = 50; // コルーチンを実行 IEnumerator coroutine = Coroutine(hoge); // コルーチンの終了を待つ yield return coroutine; // コルーチンの結果を取得 Debug.Log(coroutine.Current); } // Coroutine private IEnumerator Coroutine(int hoge) { hoge = hoge + 50; // 戻り値 yield return "hoge: " + hoge; } } |