private void Awake() { dl_head = gameObject.transform.FindChild("dl_head").GetComponent <Dropdown>(); GETAssert.notNull(dl_head, "dl_head 控件没找到"); dl_body = gameObject.transform.FindChild("dl_body").GetComponent <Dropdown>(); GETAssert.notNull(dl_head, "dl_body 控件没找到"); dl_head.onValueChanged.AddListener(onDLHeadSelect); dl_body.onValueChanged.AddListener(onDLBodySelect); LogMgr.D("in roleEditMgr awake!"); }
private List <Dropdown.OptionData> loadResInfo <T>(Hashtable map , InstanceResData <T> initData , string dirName , string keyName) where T : WResData { map.Clear(); List <Dropdown.OptionData> list = new List <Dropdown.OptionData>(); T info = null; //获取文件信息 DirectoryInfo dir = new DirectoryInfo(dirName); GETAssert.isTrue(dir.Exists, "资源目录不存在:{0}", dir.FullName); string headName; FileInfo[] allFile = dir.GetFiles(); foreach (FileInfo file in allFile) { headName = WResData.getNameByFile(file.Name, keyName); LogMgr.D(string.Format("process head file:{0}, name:{1}", file.Name, headName)); if (headName == null || "".Equals(headName)) { continue; } if (headList[headName] == null) { //装置数据 info = initData(headName); headList[headName] = info; list.Add(info); } ((T)headList[headName]).checkRes(file.Name, file.Extension); } return(list); }