Add hot-update boot pipeline, UI bundles/atlas assets, and design docs.
Ignore AIClient/Library and AIClient/HybridCLRData permanently; include HybridCLR/YooAsset project setup and UI tooling. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Pipeline / 菜单:创建 Boot 场景并写入 Build Settings。
|
||||
/// </summary>
|
||||
public static class SetupBootScene
|
||||
{
|
||||
const string ScenePath = "Assets/Scenes/Boot.unity";
|
||||
|
||||
[MenuItem("AIGame/Boot/Setup Boot Scene")]
|
||||
public static string Setup()
|
||||
{
|
||||
var scene = UnityEditor.SceneManagement.EditorSceneManager.NewScene(
|
||||
UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects,
|
||||
UnityEditor.SceneManagement.NewSceneMode.Single);
|
||||
|
||||
// 竖屏参考:调整主相机背景
|
||||
var cam = Camera.main;
|
||||
if (cam != null)
|
||||
{
|
||||
cam.backgroundColor = new Color(0.08f, 0.09f, 0.12f, 1f);
|
||||
cam.clearFlags = CameraClearFlags.SolidColor;
|
||||
}
|
||||
|
||||
var bootGo = new GameObject("Boot");
|
||||
bootGo.AddComponent<AOT.Boot.BootDriver>();
|
||||
|
||||
Directory.CreateDirectory("Assets/Scenes");
|
||||
UnityEditor.SceneManagement.EditorSceneManager.SaveScene(scene, ScenePath);
|
||||
|
||||
var scenes = new[]
|
||||
{
|
||||
new EditorBuildSettingsScene(ScenePath, true),
|
||||
};
|
||||
// 保留其它场景但 Boot 置顶
|
||||
var existing = EditorBuildSettings.scenes;
|
||||
var list = new System.Collections.Generic.List<EditorBuildSettingsScene> { scenes[0] };
|
||||
foreach (var s in existing)
|
||||
{
|
||||
if (s.path != ScenePath)
|
||||
list.Add(s);
|
||||
}
|
||||
EditorBuildSettings.scenes = list.ToArray();
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
return $"ok scene={ScenePath} buildScenes={EditorBuildSettings.scenes.Length}";
|
||||
}
|
||||
|
||||
public static string EnsurePortrait()
|
||||
{
|
||||
PlayerSettings.defaultInterfaceOrientation = UIOrientation.Portrait;
|
||||
PlayerSettings.allowedAutorotateToPortrait = true;
|
||||
PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
|
||||
PlayerSettings.allowedAutorotateToLandscapeLeft = false;
|
||||
PlayerSettings.allowedAutorotateToLandscapeRight = false;
|
||||
PlayerSettings.companyName = "XWorld";
|
||||
PlayerSettings.productName = "AIGame";
|
||||
PlayerSettings.bundleVersion = "1.0.0";
|
||||
return $"orientation={PlayerSettings.defaultInterfaceOrientation} product={PlayerSettings.productName} ver={PlayerSettings.bundleVersion}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user