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

View file

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

View file

@ -5,9 +5,10 @@
"depth": 0,
"source": "git",
"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": {
"version": "1.0.0",
@ -119,8 +120,8 @@
}
},
"jillejr.newtonsoft.json-for-unity.converters": {
"version": "1.3.0",
"depth": 0,
"version": "1.5.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity"

View file

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