Exemplo n.º 1
0
        public static DeclareNpc Create(string in_btnName, string in_cloneNpcDialog, string in_dialog, int in_funcType, int in_icon, int in_id, int in_isReq_NPC, int in_level, int in_logic_body_size, string in_name, int in_notation, int in_playerModel, string in_playerModelRes, int in_pos_X, int in_pos_Y, int in_professional, string in_professional_dialog, int in_res, int in_showCfgName, int in_size_scale, string in_speakIds, string in_speech, string in_taskShow, string in_title, int in_type, int in_zoom)
        {
            DeclareNpc tmp = new DeclareNpc();

            tmp._btnName             = in_btnName;
            tmp._cloneNpcDialog      = in_cloneNpcDialog;
            tmp._dialog              = in_dialog;
            tmp._funcType            = in_funcType;
            tmp._icon                = in_icon;
            tmp._id                  = in_id;
            tmp._isReq_NPC           = in_isReq_NPC;
            tmp._level               = in_level;
            tmp._logic_body_size     = in_logic_body_size;
            tmp._name                = in_name;
            tmp._notation            = in_notation;
            tmp._playerModel         = in_playerModel;
            tmp._playerModelRes      = in_playerModelRes;
            tmp._pos_X               = in_pos_X;
            tmp._pos_Y               = in_pos_Y;
            tmp._professional        = in_professional;
            tmp._professional_dialog = in_professional_dialog;
            tmp._res                 = in_res;
            tmp._showCfgName         = in_showCfgName;
            tmp._size_scale          = in_size_scale;
            tmp._speakIds            = in_speakIds;
            tmp._speech              = in_speech;
            tmp._taskShow            = in_taskShow;
            tmp._title               = in_title;
            tmp._type                = in_type;
            tmp._zoom                = in_zoom;

            return(tmp);
        }
Exemplo 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[]> >("DataNpc");
                if (dic == null)
                {
                    LuaEnv.SharedLuaEnv.DoString("DataNpc = require 'Lua/Config/DataNpc'");
                    dic = LuaEnv.SharedLuaEnv.Global.Get <Dictionary <int, int[]> >("DataNpc");
                }

                if (dic != null)
                {
                    _dataCaches = new Dictionary <int, DeclareNpc>(434);
                    foreach (var item in dic)
                    {
                        DeclareNpc tmp = new DeclareNpc();
                        tmp.BtnName            = CfgStringLua.Get(item.Value[0]);
                        tmp.CloneNpcDialog     = CfgStringLua.Get(item.Value[1]);
                        tmp.Dialog             = CfgStringLua.Get(item.Value[2]);
                        tmp.FuncType           = item.Value[3];
                        tmp.Icon               = item.Value[4];
                        tmp.Id                 = item.Value[5];
                        tmp.IsReqNPC           = item.Value[6];
                        tmp.Level              = item.Value[7];
                        tmp.LogicBodySize      = item.Value[8];
                        tmp.Name               = CfgStringLua.Get(item.Value[9]);
                        tmp.Notation           = item.Value[10];
                        tmp.PlayerModel        = item.Value[11];
                        tmp.PlayerModelRes     = CfgStringLua.Get(item.Value[12]);
                        tmp.PosX               = item.Value[13];
                        tmp.PosY               = item.Value[14];
                        tmp.Professional       = item.Value[15];
                        tmp.ProfessionalDialog = CfgStringLua.Get(item.Value[16]);
                        tmp.Res                = item.Value[17];
                        tmp.ShowCfgName        = item.Value[18];
                        tmp.SizeScale          = item.Value[19];
                        tmp.SpeakIds           = CfgStringLua.Get(item.Value[20]);
                        tmp.Speech             = CfgStringLua.Get(item.Value[21]);
                        tmp.TaskShow           = CfgStringLua.Get(item.Value[22]);
                        tmp.Title              = CfgStringLua.Get(item.Value[23]);
                        tmp.Type               = item.Value[24];
                        tmp.Zoom               = item.Value[25];

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