UnityEngine.SceneManagement.SceneManager.LoadSceneAsync C# (CSharp) Метод

LoadSceneAsync() публичный статический Метод

Loads the scene asynchronously in the background.

public static LoadSceneAsync ( string sceneName, [ mode ) : AsyncOperation
sceneName string Name or path of the scene to load.
mode [ If LoadSceneMode.Single then all current scenes will be unloaded before loading.
Результат UnityEngine.AsyncOperation
        public static AsyncOperation LoadSceneAsync(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            return LoadSceneAsyncNameIndexInternal(sceneName, -1, mode == LoadSceneMode.Additive, false);
        }

Same methods

SceneManager::LoadSceneAsync ( int sceneBuildIndex ) : AsyncOperation
SceneManager::LoadSceneAsync ( int sceneBuildIndex, [ mode ) : AsyncOperation
SceneManager::LoadSceneAsync ( string sceneName ) : AsyncOperation

Usage Example

Пример #1
0
    void Update()
    {
        bool  swap       = false;
        float dv         = this.delta * UnityEngine.Time.deltaTime;
        Color deltaColor = new Color(0.0f, 0.0f, 0.0f, dv);

        foreach (UiText txt in this.blink)
        {
            if (txt.color.a + dv > 1.0f)
            {
                swap = true;
            }
            else if (txt.color.a + dv < 0.0f)
            {
                swap = true;
            }
            else
            {
                txt.color = txt.color + deltaColor;
            }
        }

        if (swap)
        {
            this.delta *= -1.0f;
        }

        if (this.allowChange && Input.CheckAnyKeyDown())
        {
            SceneMng.LoadSceneAsync("Loader", SceneMode.Single);
            this.allowChange = false;
        }
    }
All Usage Examples Of UnityEngine.SceneManagement.SceneManager::LoadSceneAsync