コード例 #1
0
    IEnumerator Load()
    {
        preloader.SetState(true);

        if (OnLoadLevel != null)
        {
            OnLoadLevel(this);
        }

        if (loaderCamera)
        {
            loaderCamera.enabled = true;
        }

        if (guiCamera)
        {
            guiCamera.enabled = false;
        }

        LoaderIsDoneUnload = false;
        preloader.UpdateLoader(0.0f);

        Application.LoadLevel("Loader");         // this is loading the loader

        yield return(StartCoroutine(UpdateLoader()));

        yield return(new WaitForEndOfFrame());

        preloader.UpdateLoader(1.0f);

        yield return(null);
    }