Skip to content

Commit 508aca2

Browse files
committed
Update file(s) "Packages/unity-builder/." from "unity-korea-community/unity-builder"
1 parent 97af4fb commit 508aca2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Editor/UnityBuilder.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ public void Restore()
3232
}
3333
}
3434

35-
public class UnityBuilder
35+
public static class UnityBuilder
3636
{
3737
public static void Build()
3838
{
39-
if (GetSO_FromCommandLine("configpath", out BuildConfig config))
39+
if (TryGetSO_FromCommandLine("configpath", out BuildConfig config))
4040
{
4141
Build(config);
4242
}
@@ -86,7 +86,7 @@ public static void Build(BuildConfig buildConfig)
8686
#endif
8787
}
8888

89-
public static bool GetSO_FromCommandLine<T>(string commandLine, out T outFile)
89+
public static bool TryGetSO_FromCommandLine<T>(string commandLine, out T outFile)
9090
where T : ScriptableObject
9191
{
9292
outFile = null;
@@ -108,7 +108,13 @@ public static bool GetSO_FromCommandLine<T>(string commandLine, out T outFile)
108108
private static BuildPlayerOptions Generate_BuildPlayerOption(BuildConfig config)
109109
{
110110
List<string> sceneNames = new List<string>(config.GetBuildSceneNames());
111-
sceneNames.ForEach(sceneName => sceneName += ".unity");
111+
for (int i = 0; i < sceneNames.Count; i++)
112+
{
113+
const string sceneExtension = ".unity";
114+
string sceneName = sceneNames[i];
115+
if (sceneName.EndsWith(sceneExtension))
116+
sceneNames[i] = sceneName + sceneExtension;
117+
}
112118

113119
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions
114120
{

0 commit comments

Comments
 (0)