コード例 #1
0
ファイル: DeclareAchMedal.cs プロジェクト: chenxihan/record
        public static DeclareAchMedal Create(string in_att, int in_icon, int in_level, string in_name, int in_radio, int in_upNeedAch)
        {
            DeclareAchMedal tmp = new DeclareAchMedal();

            tmp._att       = in_att;
            tmp._icon      = in_icon;
            tmp._level     = in_level;
            tmp._name      = in_name;
            tmp._radio     = in_radio;
            tmp._upNeedAch = in_upNeedAch;

            return(tmp);
        }
コード例 #2
0
ファイル: DeclareAchMedal.cs プロジェクト: chenxihan/record
        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[]> >("DataAchMedal");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataAchMedal = require 'Lua/Config/DataAchMedal'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataAchMedal");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareAchMedal>();
                    foreach (var item in dic)
                    {
                        DeclareAchMedal tmp = new DeclareAchMedal();
                        tmp.Att       = CfgStringLua.Get(item.Value[0]);
                        tmp.Icon      = item.Value[1];
                        tmp.Level     = item.Value[2];
                        tmp.Name      = CfgStringLua.Get(item.Value[3]);
                        tmp.Radio     = item.Value[4];
                        tmp.UpNeedAch = item.Value[5];

                        _dataCaches.Add(item.Key, tmp);
                    }
                }
                Record(startTime, DateTime.Now.Ticks, "AchMedal");
            }
            if (_dataCaches == null && _fillDataCallBack != null)
            {
                if (_dataCaches == null)
                {
                    long startTime = DateTime.Now.Ticks;
                    _dataCaches = new Dictionary <int, DeclareAchMedal>();
                    _fillDataCallBack(_dataCaches);
                    Record(startTime, DateTime.Now.Ticks, "AchMedal");
                }
            }
        }