53 lines
2.5 KiB
C#
53 lines
2.5 KiB
C#
using System.Collections.Generic;
|
|
using TKS.OutGame;
|
|
using UnityEditor;
|
|
using UnityEditor.SceneManagement;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace TKS.EditorTools
|
|
{
|
|
/// <summary>
|
|
/// 시작 씬 만들기(PD 2026-11-16 「타이틀 화면은 별도의 씬으로 구성해서 타이틀 화면만 테스트할 수 있도록 분리 · 스플래쉬(회사 CI) → CDN 확인 → 타이틀」).
|
|
/// Assets/Scenes/Splash.unity(SplashBoot) · Title.unity(TitleSceneBoot) 를 만들고 빌드 순서 = Splash · Title · Battle(그 밖의 씬은 뒤에 그대로).
|
|
/// 배치: Unity.exe -batchmode -projectPath <프로젝트> -executeMethod TKS.EditorTools.BootScenesSetup.Create -quit
|
|
/// </summary>
|
|
public static class BootScenesSetup
|
|
{
|
|
public const string SplashPath = "Assets/Scenes/Splash.unity";
|
|
public const string TitlePath = "Assets/Scenes/Title.unity";
|
|
|
|
[MenuItem("TKS/Boot/Create Splash·Title Scenes (스플래시·타이틀 씬 만들기)")]
|
|
public static void Create()
|
|
{
|
|
MakeScene(SplashPath, "SplashBoot", typeof(SplashBoot));
|
|
MakeScene(TitlePath, "TitleBoot", typeof(TitleSceneBoot));
|
|
var order = new List<EditorBuildSettingsScene>
|
|
{
|
|
new EditorBuildSettingsScene(SplashPath, true),
|
|
new EditorBuildSettingsScene(TitlePath, true),
|
|
new EditorBuildSettingsScene(ProjectSetup.ScenePath, true)
|
|
};
|
|
foreach (var s in EditorBuildSettings.scenes)
|
|
if (s.path != SplashPath && s.path != TitlePath && s.path != ProjectSetup.ScenePath) order.Add(s);
|
|
EditorBuildSettings.scenes = order.ToArray();
|
|
AssetDatabase.SaveAssets();
|
|
Debug.Log("[TKS] 시작 씬 = " + SplashPath + " · " + TitlePath + " · " + ProjectSetup.ScenePath);
|
|
}
|
|
|
|
static void MakeScene(string path, string goName, System.Type boot)
|
|
{
|
|
var scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
|
|
var camGo = new GameObject("Main Camera");
|
|
camGo.tag = "MainCamera";
|
|
var cam = camGo.AddComponent<Camera>();
|
|
cam.orthographic = true;
|
|
cam.clearFlags = CameraClearFlags.SolidColor;
|
|
cam.backgroundColor = Color.black;
|
|
cam.transform.position = new Vector3(0f, 0f, -10f);
|
|
new GameObject(goName).AddComponent(boot);
|
|
EditorSceneManager.SaveScene(scene, path);
|
|
}
|
|
}
|
|
}
|