zoukankan      html  css  js  c++  java
  • 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,()=>{

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

    });

  • 相关阅读:
    帮助理解Docker,生动装逼介绍Docker
    Java 最常见 200+ 面试题 + 全解析
    CentOS7.0 yum安装 docker
    集合总结
    C#复习笔记
    match方法的使用
    偏函数
    通用装饰器
    装饰器修饰带参数的功能函数
    多个装饰器的使用
  • 原文地址:https://www.cnblogs.com/tqvdong/p/14921649.html
Copyright © 2011-2022 走看看