using System;
using System.Collections;
using UnityEngine;
public class Example : MonoBehaviour
{
private void Awake()
{
StartCoroutine(Loader());
}
private IEnumerator Loader()
{
string config = null;
yield return StartCoroutine(DownloadFile(text => { config = text;}));
yield return StartCoroutine(Handler(config));
StartGame();
}
private IEnumerator DownloadFile(Action<string> callback)
{
yield return null;
callback("");
}
private IEnumerator Handler(string text)
{
yield return null;
}
private void StartGame()
{
}
}
StartCoroutine(Request("http://anyurl.com/",
callback: res => MyHandler(res,
callback: () => StartGame())));