Пример #1
0
    private void Start()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        var helper = new LoadResourceHelper();

        var i   = 0;
        var itr = (Table.GetTableNames()).GetEnumerator();
        while (itr.MoveNext())
        {
            var tableName = itr.Current;
            {
                helper.AddLoadInfo("Table/" + tableName + ".txt", tableName + ".txt", true, true, true);
            }
        }

        helper.BeginLoad(
            () => { Table.Init(); }
            );

#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
Пример #2
0
    private void BegainLoading()
    {
        printTime(2);
        //
        GameUtils.RecordKeyPoint("BeginLoading", 13);

        //editor在不用bundle下不用加载common
        if (ResourceManager.Instance.UseAssetBundle)
        {
            {
                var __array1       = GameSetting.Instance.CommonBundleList;
                var __arrayLength1 = __array1.Length;
                for (var __i1 = 0; __i1 < __arrayLength1; ++__i1)
                {
                    var str = __array1[__i1];
                    {
                        helper.AddLoadInfo(str, false, false, true);
                    }
                }
            }
        }

        {
            var __list2      = GameSetting.Instance.ResourceList;
            var __listCount2 = __list2.Count;
            for (var __i2 = 0; __i2 < __listCount2; ++__i2)
            {
                var str = __list2[__i2];
                {
                    helper.AddLoadInfo(str);
                }
            }
        }

        //表太多了,先把缓存扩大,加载表格完成后再把缓存改回来
        mCacheSize = GameSetting.Instance.ResourceCacheMaxSize;
        GameSetting.Instance.ResourceCacheMaxSize = 500f;

        //速度慢等待提示
        if (PlayerPrefs.GetInt(GameSetting.ShowWaitingTipKey, 0) == 0)
        {
            if (null != StartupView.WaitingTip)
            {
                StartupView.WaitingTip.SetActive(true);
            }
        }

        printTime(3);

        helper.BeginLoad(() =>
        {
            StartCoroutine(OnLoadOver());
        });
    }
Пример #3
0
    private void BegainLoading()
    {
        {
            var i             = 0;
            var __enumerator1 = (Table.GetTableNames()).GetEnumerator();
            while (__enumerator1.MoveNext())
            {
                var tableName = __enumerator1.Current;
                {
                    helper.AddLoadInfo("Table/" + tableName + ".txt", tableName + ".txt", true, true, (++i) % 40 != 0);
                }
            }
        }

        //editor在不用bundle下不用加载common
        if (ResourceManager.Instance.UseAssetBundle)
        {
            {
                var __array1       = GameSetting.Instance.CommonBundleList;
                var __arrayLength1 = __array1.Length;
                for (var __i1 = 0; __i1 < __arrayLength1; ++__i1)
                {
                    var str = __array1[__i1];
                    {
                        helper.AddLoadInfo(str, false, false);
                    }
                }
            }
        }

        {
            var __list2      = GameSetting.Instance.ResourceList;
            var __listCount2 = __list2.Count;
            for (var __i2 = 0; __i2 < __listCount2; ++__i2)
            {
                var str = __list2[__i2];
                {
                    helper.AddLoadInfo(str);
                }
            }
        }

        //速度慢等待提示
        if (PlayerPrefs.GetInt(GameSetting.ShowWaitingTipKey, 0) == 0)
        {
            if (null != WaitingTip)
            {
                WaitingTip.SetActive(true);
            }
        }


        //表太多了,先把缓存扩大,加载表格完成后再把缓存改回来

        mCacheSize = GameSetting.Instance.ResourceCacheMaxSize;
        GameSetting.Instance.ResourceCacheMaxSize = 500f;

        helper.BeginLoad(() =>
        {
            PlayerPrefs.SetInt(GameSetting.ShowWaitingTipKey, 1);
            StartCoroutine(OnLoadOver());
        });
    }