コード例 #1
0
ファイル: GameApp.cs プロジェクト: s344951241/mj
 private void OnLoadUILoading()
 {
     UILoading.subTitle = "正在加载,请耐心等待";
     UILoading.ShowLoading();
     isInit = true;
     LoadNeedRes();
 }
コード例 #2
0
ファイル: GameApp.cs プロジェクト: jiangjx888/thewar
    private void ShowLoadingBar()
    {
        UILoading.subTitle = "正在加载中,请耐心等待,<color=yellow>(此加载不消耗流量)</color>";
        UILoading.ShowLoading();

        gameObject.AddComponent <ResourceMgr>();
        ResourceMgr.Instance.InitFunc = () =>
        {
            otherStep++;
            OnNeedResLoaded(new object());
            ResourceMgr.Instance.DownLoadBundles(URLConst.listInitGameRes.ToArray(), OnNeedResLoaded,
                                                 ResourceMgr.DEFAULT_PRIORITY, OnDownLoadCallBack);
        };
    }
コード例 #3
0
    public void Load(SceneVo Vo, Action <GameObject> callBack = null, string[] preloadAssets = null)
    {
        if (isLoading)
        {
            return;
        }
        UILoading.ShowLoading(string.Concat("正在进入", Vo.id, "场景..."), "正在预加载", 0);
        this.callBack             = callBack;
        this.m_sceneId            = Vo.id;
        SceneMgr.Instance.SceneVo = Vo;
        isLoading          = true;
        _isLoadingComplete = false;
        GameObjectExt.Destroy(m_kScenePrefab);
        // Loadinge
        string[] sceneURLs;
        int      len = 1;

        if (preloadAssets == null)
        {
            sceneURLs = new string[len];
        }
        else
        {
            sceneURLs = new string[len + preloadAssets.Length];
            for (int i = 0; i < preloadAssets.Length; i++)
            {
                sceneURLs[len + i] = preloadAssets[i];
            }
        }
        sceneURLs[0] = URLConst.GetScenePrefab(Vo.id);
        ResourceMgr.Instance.DownLoadBundles(
            sceneURLs,
            DownLoadComplete,
            ResourceMgr.UI_PRIORITY,
            delegate(Resource res, int listCount, int index)
        {
            totalNum++;
        });
    }