fix filename / filepaths

add build mac / build linux to editor
update packages
This commit is contained in:
minenice55 2023-06-18 23:47:22 -04:00
parent db0630e213
commit 9b62e3ca7c
4 changed files with 37 additions and 20 deletions

View file

@ -19,9 +19,28 @@ namespace UnityBuilderAction
[MenuItem("File/Build Windows")] [MenuItem("File/Build Windows")]
public static void StartWindows() public static void StartWindows()
{ {
string appName = PlayerSettings.productName;
// Get filename. // Get filename.
string path = EditorUtility.SaveFolderPanel("Build out WINDOWS to...", "", ""); string path = EditorUtility.SaveFilePanel("Build out WINDOWS to...", "", appName, "exe");
Build( BuildTarget.StandaloneWindows, 0, path + "/" ); Build( BuildTarget.StandaloneWindows, 0, path);
}
[MenuItem("File/Build Linux")]
public static void StartLinux()
{
string appName = PlayerSettings.productName;
// Get filename.
string path = EditorUtility.SaveFilePanel("Build out LINUX to...", "", appName, "");
Build( BuildTarget.StandaloneLinux64, 0, path);
}
[MenuItem("File/Build Mac")]
public static void StartMac()
{
string appName = PlayerSettings.productName;
// Get filename.
string path = EditorUtility.SaveFilePanel("Build out MAC to...", "", appName, "app");
Build( BuildTarget.StandaloneOSX, 0, path);
} }
public static void Build() public static void Build()
@ -175,20 +194,16 @@ namespace UnityBuilderAction
string[] scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray(); string[] scenes = EditorBuildSettings.scenes.Where(scene => scene.enabled).Select(s => s.path).ToArray();
string dataPath = ""; string dataPath = "";
string extension = "";
switch ( buildTarget ) { switch ( buildTarget ) {
case BuildTarget.StandaloneWindows: case BuildTarget.StandaloneWindows:
case BuildTarget.StandaloneWindows64: case BuildTarget.StandaloneWindows64:
dataPath = $"{appName}_Data/"; dataPath = $"_Data/";
extension = ".exe";
break; break;
case BuildTarget.StandaloneOSX: case BuildTarget.StandaloneOSX:
dataPath = $"{appName}.app/Contents/"; dataPath = $".app/Contents/";
extension = ".app";
break; break;
case BuildTarget.StandaloneLinux64: case BuildTarget.StandaloneLinux64:
dataPath = $"{appName}_Data/"; dataPath = $"_Data/";
extension = ".x86_64";
break; break;
} }
@ -197,14 +212,15 @@ namespace UnityBuilderAction
scenes = scenes, scenes = scenes,
target = buildTarget, target = buildTarget,
// targetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget), // targetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget),
locationPathName = filePath + $"{appName}{extension}", locationPathName = filePath,
// options = UnityEditor.BuildOptions.Development // options = UnityEditor.BuildOptions.Development
#if UNITY_2021_2_OR_NEWER #if UNITY_2021_2_OR_NEWER
subtarget = buildSubtarget subtarget = buildSubtarget
#endif #endif
}; };
string assetBundleDirectory = filePath + dataPath + "StreamingAssets"; string buildDirectory = filePath.Substring(0, filePath.LastIndexOf('/')) + "/";
string assetBundleDirectory = buildDirectory + appName + dataPath + "StreamingAssets";
if (!Directory.Exists(assetBundleDirectory)) if (!Directory.Exists(assetBundleDirectory))
{ {
Directory.CreateDirectory(assetBundleDirectory); Directory.CreateDirectory(assetBundleDirectory);

View file

@ -1,8 +1,8 @@
using System; using System;
public static class AppInfo { public static class AppInfo {
public const string Version = "0.0.978"; public const string Version = "0.0.981";
public static readonly DateTime Date = new DateTime(2023, 06, 18, 21, 34, 16, 868, DateTimeKind.Utc); public static readonly DateTime Date = new DateTime(2023, 06, 19, 03, 38, 42, 219, DateTimeKind.Utc);
} }

View file

@ -5,9 +5,10 @@
"depth": 0, "depth": 0,
"source": "git", "source": "git",
"dependencies": { "dependencies": {
"com.unity.nuget.newtonsoft-json": "3.2.1" "com.unity.nuget.newtonsoft-json": "3.2.1",
"jillejr.newtonsoft.json-for-unity.converters": "1.5.1"
}, },
"hash": "fd70aafabe1e0388c717a873b7739ba7f2d5421d" "hash": "2fb235a6da261fb1ae60112f9e9ba0d924e96bb8"
}, },
"com.unity.2d.sprite": { "com.unity.2d.sprite": {
"version": "1.0.0", "version": "1.0.0",
@ -119,8 +120,8 @@
} }
}, },
"jillejr.newtonsoft.json-for-unity.converters": { "jillejr.newtonsoft.json-for-unity.converters": {
"version": "1.3.0", "version": "1.5.1",
"depth": 0, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity" "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity"

View file

@ -134,7 +134,7 @@ PlayerSettings:
16:10: 1 16:10: 1
16:9: 1 16:9: 1
Others: 1 Others: 1
bundleVersion: 0.0.978 bundleVersion: 0.0.981
preloadedAssets: preloadedAssets:
- {fileID: 102900000, guid: 5348c08b82446e0478cee8bda6c02cfc, type: 3} - {fileID: 102900000, guid: 5348c08b82446e0478cee8bda6c02cfc, type: 3}
metroInputSource: 0 metroInputSource: 0
@ -158,11 +158,11 @@ PlayerSettings:
applicationIdentifier: applicationIdentifier:
Standalone: com.RHeavenStudio.Heaven-Studio Standalone: com.RHeavenStudio.Heaven-Studio
buildNumber: buildNumber:
Standalone: 978 Standalone: 981
iPhone: 0 iPhone: 0
tvOS: 0 tvOS: 0
overrideDefaultApplicationIdentifier: 0 overrideDefaultApplicationIdentifier: 0
AndroidBundleVersionCode: 978 AndroidBundleVersionCode: 981
AndroidMinSdkVersion: 22 AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 0 AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1 AndroidPreferredInstallLocation: 1