public WXNGUITree(GameObject prefabRoot, string prefabPath, bool exportAsScene, bool rootExport = false) : base(prefabPath) { this.prefabRoot = prefabRoot; this.prefabPath = prefabPath; this.exportAsScene = exportAsScene; this.exportSceneRoot = rootExport; exportName = WXUtility.GetFileNameFromPath(prefabPath); }
public WXPrefab(GameObject prefabRoot, string prefabPath) { if (!prefabPath.EndsWith(".prefab")) { this.prefabPath = prefabPath + ".prefab"; } else { this.prefabPath = prefabPath; } this.prefabRoot = prefabRoot; exportName = WXUtility.GetFileNameFromPath(prefabPath); }
public WXPrefab(GameObject prefabRoot, string prefabPath) : base(prefabPath) { if (!prefabPath.EndsWith(".prefab")) { this.prefabPath = prefabPath + ".prefab"; } else { this.prefabPath = prefabPath; } this.prefabRoot = prefabRoot; exportName = WXUtility.GetFileNameFromPath(prefabPath); if (unityAssetPath == null || unityAssetPath == "") { ErrorUtil.ExportErrorReporter.create() .setResource(this) .setGameObject(prefabRoot) .error(0, "Mesh文件的unity路径为空"); } }
public static void writeGroup(WXResource resource, ExportPreset preset) { try { EditorUtility.DisplayProgressBar( "导出资源", "资源读取中...", 0.33f ); string resourcePath = resource.Export(preset); EditorUtility.DisplayProgressBar( "导出资源", "文件写入中...", 0.66f ); string packageName = WXUtility.GetFileNameFromPath(resourcePath); if (packageName == "") { packageName = "Untitled"; } ExportStore.GenerateResourcePackage( packageName, resourcePath ); } catch (Exception e) { Debug.LogError(e.Message); Debug.LogError(e.StackTrace); } finally { EditorUtility.ClearProgressBar(); } }