• loading通用界面笔记


    Private Action proCB = null;

    public void AsyncLoadScene(string sceneName, Action loaded)

        {

            loadingWnd.SetWndState();

            AsyncOperation sceneAsync = SceneManager.LoadSceneAsync(sceneName);

            prgCB = () =>

            {

                float val = sceneAsync.progress;

                loadingWnd.SetProgress(val);

                if (val == 1)

                {

                    if (loaded != null)

                    {

                        loaded();

                    }

                    prgCB = null;

                    sceneAsync = null;

                    loadingWnd.SetWndState(false);

                }

            };

    }

    void Update()

        {

            if (prgCB != null)

            {

                prgCB();

            }

        }

    String sceneName;

    AsyncLoadScene(sceneName,()=>{

    //新场景加载成功后执行,初始化新场景

    });

  • 相关阅读:
    pytest_04
    pytest_03
    pytest_02
    CF 1416C XOR Trie
    CF 1413D
    ZOJ 3725 概率dp
    ZOJ 3726
    位运算
    CF1439C 线段树
    unordered_set
  • 原文地址:https://www.cnblogs.com/tqvdong/p/14921649.html
Copyright © 2020-2023  润新知