parent
d5f301fd30
commit
374ecc1d2a
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -9,6 +10,7 @@ using UnityEditor.Build.Reporting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
|
using Debug = UnityEngine.Debug;
|
||||||
|
|
||||||
namespace ZEditor
|
namespace ZEditor
|
||||||
{
|
{
|
||||||
|
@ -27,9 +29,9 @@ namespace ZEditor
|
||||||
WebGL,
|
WebGL,
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string pc = "Builds/PC";
|
private static string pc = "Builds/PC/Game.exe";
|
||||||
private static string webgl = "Builds/WebGL";
|
private static string webgl = "Builds/WebGL";
|
||||||
private static string android = "Builds/Android";
|
private static string android = "Builds/Android/Game.apk";
|
||||||
|
|
||||||
#region Win
|
#region Win
|
||||||
|
|
||||||
|
@ -104,6 +106,8 @@ namespace ZEditor
|
||||||
|
|
||||||
if (summary.result == BuildResult.Succeeded)
|
if (summary.result == BuildResult.Succeeded)
|
||||||
{
|
{
|
||||||
|
string path = Application.dataPath.Replace("Assets", outputFilePath);
|
||||||
|
OpenFolder(path);
|
||||||
Debug.Log($"{buildTarget} 平台构建完成! ");
|
Debug.Log($"{buildTarget} 平台构建完成! ");
|
||||||
}
|
}
|
||||||
else if (summary.result == BuildResult.Cancelled)
|
else if (summary.result == BuildResult.Cancelled)
|
||||||
|
@ -121,6 +125,23 @@ namespace ZEditor
|
||||||
// Progress.Start("explorer.exe", outputFilePath);
|
// Progress.Start("explorer.exe", outputFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void OpenFolder(string path)
|
||||||
|
{
|
||||||
|
// 根据不同的操作系统调用不同的命令来打开文件夹
|
||||||
|
switch (Application.platform)
|
||||||
|
{
|
||||||
|
case RuntimePlatform.WindowsEditor:
|
||||||
|
Process.Start("explorer.exe", path);
|
||||||
|
break;
|
||||||
|
case RuntimePlatform.OSXEditor:
|
||||||
|
Process.Start("open", path);
|
||||||
|
break;
|
||||||
|
case RuntimePlatform.LinuxEditor:
|
||||||
|
Process.Start("xdg-open", path);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
static void ChangeAssetLoadMode(BuildType buildType)
|
static void ChangeAssetLoadMode(BuildType buildType)
|
||||||
{
|
{
|
||||||
|
@ -156,6 +177,8 @@ namespace ZEditor
|
||||||
else
|
else
|
||||||
Debug.LogError("检查一下,打包出问题了!没找到global");
|
Debug.LogError("检查一下,打包出问题了!没找到global");
|
||||||
|
|
||||||
|
EditorUtility.SetDirty(gameObject);
|
||||||
|
|
||||||
Debug.Log($"资源加载模式自动更改为 {playMode}.");
|
Debug.Log($"资源加载模式自动更改为 {playMode}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue