generated from StansAssets/Unity-Package-Sample
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9790c1
commit 9713b23
Showing
34 changed files
with
646 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
45 changes: 45 additions & 0 deletions
45
com.stansassets.scene-management/BuildConfigurator/BuildConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
|
||
namespace StansAssets.SceneManagement.Build | ||
{ | ||
[Serializable] | ||
public class BuildConfiguration | ||
{ | ||
public string Name = string.Empty; | ||
public bool DefaultScenesFirst = false; | ||
public List<SceneAsset> DefaultScenes = new List<SceneAsset>(); | ||
public List<PlatformsConfiguration> Platforms = new List<PlatformsConfiguration>(); | ||
|
||
public bool IsEmpty => DefaultScenes.Count == 0 && Platforms.Count == 0; | ||
|
||
public BuildConfiguration Copy() | ||
{ | ||
var copy = new BuildConfiguration(); | ||
copy.Name = Name + " Copy"; | ||
foreach (var scene in DefaultScenes) | ||
{ | ||
copy.DefaultScenes.Add(scene); | ||
} | ||
|
||
foreach (var platformsConfiguration in Platforms) | ||
{ | ||
var p = new PlatformsConfiguration(); | ||
foreach (var target in platformsConfiguration.BuildTargets) | ||
{ | ||
p.BuildTargets.Add(target); | ||
} | ||
|
||
foreach (var scene in platformsConfiguration.Scenes) | ||
{ | ||
p.Scenes.Add(scene); | ||
} | ||
|
||
copy.Platforms.Add(p); | ||
} | ||
|
||
return copy; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
com.stansassets.scene-management/BuildConfigurator/BuildConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
com.stansassets.scene-management/BuildConfigurator/BuildConfigurationMenu.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using UnityEditor; | ||
|
||
namespace StansAssets.SceneManagement.Build | ||
{ | ||
public static class BuildConfigurationMenu | ||
{ | ||
[MenuItem(SceneManagementPackage.RootMenu + "Build Settings", false, 1)] | ||
public static void OpenBuildSettings() { | ||
BuildConfigurationWindow.ShowTowardsInspector("Build Conf"); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
com.stansassets.scene-management/BuildConfigurator/BuildConfigurationMenu.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
com.stansassets.scene-management/BuildConfigurator/BuildConfigurationSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.Generic; | ||
using StansAssets.Plugins; | ||
|
||
namespace StansAssets.SceneManagement.Build { | ||
|
||
public class BuildConfigurationSettings : PackageScriptableSettingsSingleton<BuildConfigurationSettings> | ||
{ | ||
protected override bool IsEditorOnly => true; | ||
public override string PackageName => SceneManagementPackage.PackageName; | ||
|
||
|
||
public int ActiveConfigurationIndex = 0; | ||
public List<BuildConfiguration> BuildConfigurations = new List<BuildConfiguration>(); | ||
|
||
public BuildConfiguration Configuration => ActiveConfigurationIndex >= BuildConfigurations.Count | ||
? new BuildConfiguration() | ||
: BuildConfigurations[ActiveConfigurationIndex]; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
com.stansassets.scene-management/BuildConfigurator/BuildConfigurationSettings.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.