/** 生成打包信息文件并复制打包文件到发布目录 */ private void copyFilesAndInfo() { //复制bundle文件 string buildPath = ShineToolGlobal.bundleTempPath + "/" + _targetName; string releasePath = getTargetSourcePath() + "/" + ShineToolGlobal.bundleDirName; if (!Directory.Exists(releasePath)) { Directory.CreateDirectory(releasePath); } FileUtils.clearDir(releasePath); SList <string> delBundleList = new SList <string>(); string[] files = Directory.GetFiles(buildPath, "*.bundle"); for (int i = 0; i < files.Length; i++) { string fromFileName = files[i]; string fileName = Path.GetFileName(fromFileName); //如果是无效bundle if (!_bundleInfoDataList.contains(fileName)) { delBundleList.add(fromFileName); delBundleList.add(fromFileName + ".manifest"); continue; } string toFileName = Path.Combine(releasePath, fileName); File.Copy(fromFileName, toFileName); } //删除无效bundle以及对应manifest foreach (string filePath in delBundleList) { Ctrl.print("删除无效文件", filePath); File.Delete(filePath); } //生成打包信息文件 string infoPath = getTargetSourcePath() + "/" + ShineGlobal.bundleInfoPath; BytesWriteStream buffer = new BytesWriteStream(); buffer.writeVersion(ShineGlobal.bundleInfoVersion); buffer.writeInt(_bundleInfoDataList.length()); foreach (BundleInfoData info in _bundleInfoDataList) { info.writeBytes(buffer); } buffer.writeInt(_resourceInfoDataList.length()); foreach (ResourceInfoData info in _resourceInfoDataList) { info.writeBytes(buffer); } FileUtils.writeFileForBytes(infoPath, buffer); }
// /** 设置服务器指令组 */ // public void setServerCmdSet(SSet<string> value) // { // if(value==null) // return; // // value.forEach(k=> // { // if(_cmdDic.contains(k) && !k.Equals("help")) // { // Ctrl.throwError("重复的gm指令(与服务器冲突):",k); // } // }); // } private void addCmdObj(string cmd, Obj obj) { if (_cmdDic.contains(cmd)) { Ctrl.throwError("重复的gm指令:" + cmd); return; } _cmdDic.put(cmd, obj); }
/** 执行添加方法 */ public void toAddMethod(ILMethodInfo method) { string key = method.getKey(); //不重复添加 if (methodKeys.contains(key)) { return; } methods.add(method); methodKeys.put(key, method); }
private static void makeOneNode(UIObjectData data, Transform tf) { //先prefab if (PrefabUtility.IsAnyPrefabInstanceRoot(tf.gameObject)) { string prefabPath = PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot(tf.gameObject); // Ctrl.print("element",prefabPath); if (_elementDic.contains(prefabPath)) { data.type = UIElementType.Element; data.style = _elementDic.get(prefabPath); if (data.style == null) { data.style = ""; } } else { makeContainer(data, tf); } } else { //控件 if (tf.GetComponent <CanvasRenderer>() != null) { if (tf.GetComponent <SContainer>() != null) { makeContainer(data, tf); } else if (tf.GetComponent <Button>() != null) { data.type = UIElementType.Button; } else if (tf.GetComponent <ImageFrameContainer>() != null) { data.type = UIElementType.ImageFrameContainer; } else if (tf.GetComponent <SScrollViewFake3D>() != null) { data.type = UIElementType.SScrollViewFake3D; SScrollViewFake3D sScrollView = tf.GetComponent <SScrollViewFake3D>(); data.strArgs = new string[1]; data.strArgs[0] = sScrollView.gridElement; } else if (tf.GetComponent <SScrollView>() != null) { data.type = UIElementType.SScrollView; SScrollView sScrollView = tf.GetComponent <SScrollView>(); data.strArgs = new string[1]; data.strArgs[0] = sScrollView.gridElement; } else if (tf.GetComponent <SPageView>() != null) { data.type = UIElementType.SPageView; SPageView sPageView = tf.GetComponent <SPageView>(); data.strArgs = new string[1]; data.strArgs[0] = sPageView.gridElement; } else if (tf.GetComponent <RawImageLoader>() != null) { data.type = UIElementType.RawImageLoader; } else if (tf.GetComponent <RawImage>() != null) { data.type = UIElementType.RawImage; } else if (tf.GetComponent <AdvancedText>() != null) { data.type = UIElementType.TextField; } else if (tf.GetComponent <InputField>() != null) { data.type = UIElementType.InputField; } else if (tf.GetComponent <BloodBar>() != null) { data.type = UIElementType.BloodBar; } else if (tf.GetComponent <Scrollbar>() != null) { data.type = UIElementType.ScrollBar; } else if (tf.GetComponent <Dropdown>() != null) { data.type = UIElementType.Dropdown; } else if (tf.GetComponent <Toggle>() != null) { data.type = UIElementType.Toggle; } else if (tf.GetComponent <Slider>() != null) { data.type = UIElementType.Slider; } else if (tf.GetComponent <ImageLoader>() != null) { data.type = UIElementType.ImageLoader; } else if (tf.GetComponent <Image>() != null) { data.type = UIElementType.Image; } else if (tf.GetComponent <I18NText>() != null) { data.type = UIElementType.I18NText; } else if (tf.GetComponent <Text>() != null) { data.type = UIElementType.Text; } else if (tf.GetComponent <SkeletonGraphicLoader>() != null) { data.type = UIElementType.SkeletonGraphicLoader; } else if (tf.GetComponent <SkeletonGraphic>() != null) { data.type = UIElementType.SkeletonGraphic; } else if (tf.GetComponent <GuideMask>() != null) { data.type = UIElementType.GuideMask; } else //其他脚本 { makeContainer(data, tf); } } else { if (tf.GetComponent <Toggle>() != null) { data.type = UIElementType.Toggle; } else if (tf.GetComponent <Slider>() != null) { data.type = UIElementType.Slider; } else //什么都没有 { makeContainer(data, tf); } } } }
/** 是否有某文件的记录 */ public bool hasFile(string path) { return(_dic.contains(path)); }
/// <summary> /// Map包含 /// </summary> public bool func_MapContains(TriggerExecutor e, TriggerArg a, SMap <object, object> map, object key) { return(map.contains(key)); }