public SceneLogicConfig GetSceneLogicConfig(int resId, int id)
        {
            SceneLogicConfig cfg     = null;
            MapDataProvider  mapData = SceneConfigProvider.Instance.GetMapDataBySceneResId(resId);

            if (null != mapData)
            {
                cfg = mapData.m_SceneLogicMgr.GetDataById(id);
            }
            return(cfg);
        }
示例#2
0
        public void PreLoadSceneNpcSkills(int sceneid)
        {
            MapDataProvider mdp = SceneConfigProvider.Instance.GetMapDataBySceneResId(sceneid);

            if (mdp != null)
            {
                DataDictionaryMgr <Data_Unit> ddm = mdp.m_UnitMgr;
                if (ddm != null)
                {
                    MyDictionary <int, object> dataDic = ddm.GetData();
                    if (dataDic != null)
                    {
                        List <int> linkidlist = new List <int>();
                        linkidlist.Clear();
                        List <int> skilllist = new List <int>();
                        skilllist.Clear();
                        foreach (object obj in dataDic.Values)
                        {
                            Data_Unit du = obj as Data_Unit;
                            if (du != null)
                            {
                                if (!linkidlist.Contains(du.m_LinkId))
                                {
                                    linkidlist.Add(du.m_LinkId);
                                }
                            }
                        }
                        foreach (int linkid in linkidlist)
                        {
                            Data_NpcConfig dnc = NpcConfigProvider.Instance.GetNpcConfigById(linkid);
                            if (dnc != null && dnc.m_SkillList != null)
                            {
                                foreach (int skillid in dnc.m_SkillList)
                                {
                                    if (!skilllist.Contains(skillid))
                                    {
                                        skilllist.Add(skillid);
                                    }
                                }
                            }
                        }
                        foreach (int skillid in skilllist)
                        {
                            PreloadNewSkillInstance(skillid);
                        }
                    }
                }
            }
        }