반응형
- 코드 작성
using System.Collections;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
using UnityEngine.UI;
public class ExampleUniRX : MonoBehaviour
{
private void Start()
{
var parallel = Observable.WhenAll(
ObservableWWW.Get("http://google.com/"),
ObservableWWW.Get("http://bing.com/"),
ObservableWWW.Get("http://unity3d.com"));
parallel.Subscribe(xs =>
{
Debug.Log(xs[0].Substring(0, 100));
Debug.Log(xs[1].Substring(0, 100));
Debug.Log(xs[2].Substring(0, 100));
});
}
void DownloadFile()
{
var resourcePathURL = "http://torisoup.net/unirx-examples/resources/resourcepath.txt";
ObservableWWW.Get(resourcePathURL)
.SelectMany(resourceUrl => ObservableWWW.Get(resourceUrl))
.Subscribe(Debug.Log);
}
}
참고할만한 글
반응형