public static void make() { _uiElementDic.clear(); _uiModelDic.clear(); initElementNames(); foreach (var v in _elementPrefabDic) { Transform tf = v.transform; UIObjectData element = new UIObjectData(); element.name = tf.gameObject.name; element.type = UIElementType.Element; element.style = ""; if (tf.gameObject.tag.Equals("G")) { element.style = "G"; } makeNode(element, tf); _uiElementDic.put(element.name, element); } //生成新预处理列表 string[] files = FileUtils.getDeepFileList(ShineToolGlobal.uiModelsPath, "prefab"); for (int i = 0; i < files.Length; i++) { string assetsPath = ToolFileUtils.getAssetsPath(files[i]); GameObject prefab = AssetDatabase.LoadAssetAtPath <GameObject>(assetsPath); Transform tf = prefab.transform; UIObjectData element = new UIObjectData(); element.name = tf.gameObject.name; element.type = UIElementType.Model; element.style = ""; if (tf.gameObject.tag.Equals("G")) { element.style = "G"; } makeNode(element, tf); _uiModelDic.put(element.name, element); } writeBytes(); ToolFileUtils.executeServerTool("uiModel"); Ctrl.print("OK"); }
protected virtual void doShowScene() { _elementDic = _currentSceneData.elements; _elementDicByObj.clear(); _elementDic.forEachValue(v => { makeElementModel(v); if (v.gameObject != null) { _elementDicByObj.put(v.gameObject, v); } else { Ctrl.errorLog("不支持的单位类型", v.config.type); } }); }
/** 加载文件记录 */ public void read(bool allClear) { _isAllClear = allClear; _dic.clear(); _lastSet.clear(); //allClear不读 if (File.Exists(_path) && !_isAllClear) { XML xml = FileUtils.readFileForXML(_path); String oldVersion = xml.getProperty("version"); //版本对 if (oldVersion.Equals(_version)) { foreach (XML xl in xml.getChildrenByName("info")) { FileRecordData data = new FileRecordData(); data.lastModified = Convert.ToInt64(xl.getProperty("lastModified")); data.length = Convert.ToInt64(xl.getProperty("length")); data.md5 = xl.getProperty("md5"); data.ex = xl.getProperty("ex"); data.ex2 = xl.getProperty("ex2"); data.ex3 = xl.getProperty("ex3"); data.ex4 = xl.getProperty("ex4"); _dic.put(xl.getProperty("path"), data); _lastSet.add(xl.getProperty("path")); _isNew = false; } } } }
/** 清空md5记录 */ public void clearMD5Record() { _md5Dic.clear(); }
/// <summary> /// Map清空 /// </summary> public void func_MapClear(TriggerExecutor e, TriggerArg a, SMap <object, object> map) { map.clear(); }