Esempio n. 1
0
        public static DeclareUIConfig Create(string in_closeSFX, string in_componentScript, int in_id, string in_name, string in_openSFX)
        {
            DeclareUIConfig tmp = new DeclareUIConfig();

            tmp._closeSFX        = in_closeSFX;
            tmp._componentScript = in_componentScript;
            tmp._id      = in_id;
            tmp._name    = in_name;
            tmp._openSFX = in_openSFX;

            return(tmp);
        }
Esempio n. 2
0
        public static void SetData()
        {
            if (_dataCaches == null && LuaEnv.isLoadLuaCfg)
            {
                long startTime = DateTime.Now.Ticks;
                Dictionary <int, int[]> dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataUIConfig");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataUIConfig = require 'Lua/Config/DataUIConfig'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataUIConfig");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <string, DeclareUIConfig>(397);
                    foreach (var item in dic)
                    {
                        DeclareUIConfig tmp = new DeclareUIConfig();
                        tmp.CloseSFX        = CfgStringLua.Get(item.Value[0]);
                        tmp.ComponentScript = CfgStringLua.Get(item.Value[1]);
                        tmp.Id      = item.Value[2];
                        tmp.Name    = CfgStringLua.Get(item.Value[3]);
                        tmp.OpenSFX = CfgStringLua.Get(item.Value[4]);

                        _dataCaches.Add(CfgStringLua.Get(item.Key), tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "UIConfig");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <string, DeclareUIConfig>(397);
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "UIConfig");
                }
            }
        }