Пример #1
0
    public void Load(string toLoad)
    {
        LoadTransferer l = Instantiate(loadTransferer, this.transform.position, Quaternion.identity) as LoadTransferer;

        l.sceneToLoad = toLoad;
        SceneManager.LoadScene("Loading");
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        LoadTransferer l = FindObjectOfType <LoadTransferer> ();

        if (l != null)
        {
            StartCoroutine(LoadAsync(l));
        }
    }
Пример #3
0
    private IEnumerator LoadAsync(LoadTransferer l)
    {
        AsyncOperation operation = SceneManager.LoadSceneAsync(l.sceneToLoad);

        Destroy(l.gameObject);
        while (!operation.isDone)
        {
            Debug.Log(operation.progress);
            yield return(null);
        }
    }