イラスト、モデリング、Unity、VR関連

unityとかblenderとかvr関連の作業メモ

c# 非同期処理実行結果

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading.Tasks;

void Start(){
      Debug.Log("111");
      Kx();
      Debug.Log("222");
    }
    async void Kx(){
      Task.Delay(3000);
      Debug.Log("KX");
    }

111
kx
222


void Start(){
      Debug.Log("111");
      Kx();
      Debug.Log("222");
    }
    async void Kx(){
      await Task.Delay(3000);
      Debug.Log("KX");
    }    

111
222
kx

void Start(){
      Debug.Log("111");
      Kx();
      Debug.Log("222");
    }
    async Task Kx(){
      await Task.Delay(3000);
      Debug.Log("KX");
    }

111
222
kx

    void Start(){
      Debug.Log("111");
      Task.Run(()=>Kx());
      Debug.Log("222");
    }
    void Kx(){
      Task.Delay(3000);
      Debug.Log("KX");
    }    

111
222
kx

    async void Start(){
      Debug.Log("111");
      await Task.Run(()=>Kx());
      Debug.Log("222");
    }
    void Kx(){
      Task.Delay(3000);
      Debug.Log("KX");
    }    

111
kx
222