Skip to content

Commit

Permalink
Version 1.2.1 - Allow specify target platforms of MacOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
HanzaRu committed Aug 9, 2023
0 parents commit 1dde1d5
Show file tree
Hide file tree
Showing 51 changed files with 1,863 additions and 0 deletions.
Binary file added .icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions Editor/BuildScriptEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using GameWorkstore.Automation;
using UnityEditor;
using UnityEngine;

namespace GameworkStore.Automation.Editor
{
[CustomEditor(typeof(BuildScript))]
public class BuildScriptEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
BuildScript buildScript = (BuildScript)target;
if(!buildScript) return;
Show(buildScript);
}

public void Show(BuildScript buildScript)
{
ShowButtonCreate<AndroidBuildPlatform>(buildScript, nameof(AndroidBuildPlatform));
ShowButtonCreate<IOSBuildPlatform>(buildScript, nameof(IOSBuildPlatform));
ShowButtonCreate<WindowsBuildPlatform>(buildScript, nameof(WindowsBuildPlatform));
ShowButtonCreate<LinuxBuildPlatform>(buildScript, nameof(LinuxBuildPlatform));
ShowButtonCreate<MacOSBuildPlatform>(buildScript, nameof(MacOSBuildPlatform));
ShowButtonCreate<ServerWindowsBuildPlatform>(buildScript, nameof(ServerWindowsBuildPlatform));
ShowButtonCreate<ServerMacOSBuildPlatform>(buildScript, nameof(ServerMacOSBuildPlatform));
ShowButtonCreate<ServerLinuxBuildPlatform>(buildScript, nameof(ServerLinuxBuildPlatform));
ShowButtonCreate<WebGLBuildPlatform>(buildScript, nameof(WebGLBuildPlatform));
ShowButtonCreate<UWPBuildPlatform>(buildScript, nameof(UWPBuildPlatform));

}

public static void ShowButtonCreate<T>(BuildScript buildScript, string name) where T : BuildPlatform
{
if(buildScript.Has<T>()) return;
if (GUILayout.Button("New "+ObjectNames.NicifyVariableName(name)))
{
MakeNewBuildPlatform<T>(buildScript, name);
}
}

public static void MakeNewBuildPlatform<T>(BuildScript buildScript, string name) where T : BuildPlatform
{
if(buildScript.Has<T>()) return;
T bp = CreateInstance<T>();
bp.name = name;
PosCreateBuildInstance(buildScript, bp);
}

public static void PosCreateBuildInstance(BuildScript buildScript, BuildPlatform bp)
{
buildScript.BuildPlatforms.Add(bp);
bp.InitializeScriptable(buildScript);

AssetDatabase.AddObjectToAsset(bp, buildScript);
AssetDatabase.SaveAssets();

EditorUtility.SetDirty(buildScript);
EditorUtility.SetDirty(bp);
}
}
}
11 changes: 11 additions & 0 deletions Editor/BuildScriptEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Editor/GameWorkstore.Automation.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "GameWorkstore.Automation.Editor",
"rootNamespace": "",
"references": [
"GUID:381921da55d39454f9a6ce7095941507",
"GUID:c32d36751e998d74999be5c29b033d6e"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Editor/GameWorkstore.Automation.Editor.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Editor/Textures.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Editor/Textures/icons8-foundation-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 159 additions & 0 deletions Editor/Textures/icons8-foundation-30.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Editor/Textures/icons8-palete-30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1dde1d5

Please sign in to comment.