コード例 #1
0
    public static int GetLazyLoadConfigAssetInfo(IntPtr l)
    {
        int result;

        try
        {
            ClientConfigDataLoaderBase clientConfigDataLoaderBase = (ClientConfigDataLoaderBase)LuaObject.checkSelf(l);
            string configDataName;
            LuaObject.checkType(l, 2, out configDataName);
            string configAssetName;
            LuaObject.checkType(l, 3, out configAssetName);
            ClientConfigDataLoaderBase.LazyLoadConfigAssetInfo lazyLoadConfigAssetInfo = clientConfigDataLoaderBase.GetLazyLoadConfigAssetInfo(configDataName, configAssetName);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, lazyLoadConfigAssetInfo);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
コード例 #2
0
        // Token: 0x06001CA0 RID: 7328 RVA: 0x000994C8 File Offset: 0x000976C8
        protected override IEnumerator InitDefaultStringTable(Action <bool> onEnd)
        {
            bool?  ret = null;
            string currLocalization = this.m_currLocalization;

            if (currLocalization != null)
            {
                if (!(currLocalization == "CN"))
                {
                    if (currLocalization == "EN")
                    {
                        string configDataName  = "ConfigDataST_EN";
                        string configAssetName = string.Format("{0}/ConfigDataST_EN.asset", this.m_configLoader.GetConfigDataPath());
                        ClientConfigDataLoaderBase.LazyLoadConfigAssetInfo lazyLoadConfigAssetInfo = this.m_configLoader.GetLazyLoadConfigAssetInfo(configDataName, configAssetName);
                        if (lazyLoadConfigAssetInfo == null)
                        {
                            Debug.LogError(string.Format("InitDefaultStringTable error: configAsset with name: {0} not exist", configAssetName));
                            if (onEnd != null)
                            {
                                onEnd(false);
                            }
                            yield break;
                        }
                        switch (lazyLoadConfigAssetInfo.m_state)
                        {
                        case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Unload:
                            this.m_configLoader.LoadLazyLoadConfigDataAsset(configDataName, configAssetName, delegate(bool lret)
                            {
                                if (!lret)
                                {
                                    Debug.LogError(string.Format("InitDefaultStringTable error:  LoadLazyLoadConfigDataAsset with configAssetName:{0} failed", configAssetName));
                                    ret = new bool?(false);
                                }
                                else
                                {
                                    IConfigDataLoader configDataLoader = this.m_configLoader as IConfigDataLoader;
                                    IEnumerable <KeyValuePair <int, ConfigDataST_EN> > allConfigDataST_EN = configDataLoader.GetAllConfigDataST_EN();
                                    foreach (KeyValuePair <int, ConfigDataST_EN> keyValuePair in allConfigDataST_EN)
                                    {
                                        this.m_ConfigDataST.Add(keyValuePair.Key, keyValuePair.Value.Value);
                                    }
                                    ret = new bool?(true);
                                }
                            });
                            break;

                        case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Loaded:
                            ret = new bool?(true);
                            break;

                        case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Loadfailed:
                            Debug.LogError(string.Format("InitDefaultStringTable error: LazyLoadConfigAsssetState.Loadfailed", new object[0]));
                            ret = new bool?(false);
                            break;
                        }
                        goto IL_31B;
                    }
                }
                else
                {
                    string configDataName2 = "ConfigDataST_CN";
                    string configAssetName = string.Format("{0}/ConfigDataST_CN.asset", this.m_configLoader.GetConfigDataPath());
                    ClientConfigDataLoaderBase.LazyLoadConfigAssetInfo lazyLoadConfigAssetInfo2 = this.m_configLoader.GetLazyLoadConfigAssetInfo(configDataName2, configAssetName);
                    if (lazyLoadConfigAssetInfo2 == null)
                    {
                        Debug.LogError(string.Format("InitDefaultStringTable error: configAsset with name: {0} not exist", configAssetName));
                        if (onEnd != null)
                        {
                            onEnd(false);
                        }
                        yield break;
                    }
                    switch (lazyLoadConfigAssetInfo2.m_state)
                    {
                    case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Unload:
                        this.m_configLoader.LoadLazyLoadConfigDataAsset(configDataName2, configAssetName, delegate(bool lret)
                        {
                            if (!lret)
                            {
                                Debug.LogError(string.Format("InitDefaultStringTable error:  LoadLazyLoadConfigDataAsset with configAssetName:{0} failed", configAssetName));
                                ret = new bool?(false);
                            }
                            else
                            {
                                IConfigDataLoader configDataLoader = this.m_configLoader as IConfigDataLoader;
                                IEnumerable <KeyValuePair <int, ConfigDataST_CN> > allConfigDataST_CN = configDataLoader.GetAllConfigDataST_CN();
                                foreach (KeyValuePair <int, ConfigDataST_CN> keyValuePair in allConfigDataST_CN)
                                {
                                    this.m_ConfigDataST.Add(keyValuePair.Key, keyValuePair.Value.Value);
                                }
                                ret = new bool?(true);
                            }
                        });
                        break;

                    case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Loaded:
                        ret = new bool?(true);
                        break;

                    case ClientConfigDataLoaderBase.LazyLoadConfigAsssetState.Loadfailed:
                        Debug.LogError(string.Format("InitDefaultStringTable error: LazyLoadConfigAsssetState.Loadfailed", new object[0]));
                        ret = new bool?(false);
                        break;
                    }
                    goto IL_31B;
                }
            }
            Debug.LogError(string.Format("InitDefaultStringTable error: localization: {0} not support", this.m_currLocalization));
            ret = new bool?(false);
IL_31B:
            while (ret == null)
            {
                yield return(null);
            }
            bool rret = false;

            if (ret != null && (ret.GetValueOrDefault() && ret != null))
            {
                rret = true;
            }
            if (onEnd != null)
            {
                onEnd(rret);
            }
            yield break;
        }