Add Windows standalone build and include runtime shaders
CI / test (push) Successful in 6m57s
Details
CI / test (push) Successful in 6m57s
Details
This commit is contained in:
parent
8b813a9d6e
commit
dfd766eaad
|
|
@ -0,0 +1,71 @@
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Vanguard.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Сборка Windows standalone. В GUI — меню Vanguard, из CI —
|
||||
/// -executeMethod Vanguard.Editor.StandaloneBuild.BuildWindowsCli.
|
||||
/// </summary>
|
||||
public static class StandaloneBuild
|
||||
{
|
||||
[MenuItem("Vanguard/Build Windows Standalone")]
|
||||
public static void BuildWindows()
|
||||
{
|
||||
Build(cli: false);
|
||||
}
|
||||
|
||||
public static void BuildWindowsCli()
|
||||
{
|
||||
Build(cli: true);
|
||||
}
|
||||
|
||||
private static void Build(bool cli)
|
||||
{
|
||||
var scenes = EditorBuildSettings.scenes
|
||||
.Where(scene => scene.enabled)
|
||||
.Select(scene => scene.path)
|
||||
.ToArray();
|
||||
if (scenes.Length == 0)
|
||||
{
|
||||
Debug.LogError("No enabled scenes in Build Settings.");
|
||||
if (cli)
|
||||
EditorApplication.Exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
var output = Path.GetFullPath(
|
||||
Path.Combine(Application.dataPath, "../Builds/Windows/VanguardReMaster.exe"));
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(output) ?? "Builds/Windows");
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
|
||||
{
|
||||
scenes = scenes,
|
||||
locationPathName = output,
|
||||
target = BuildTarget.StandaloneWindows64,
|
||||
options = BuildOptions.None,
|
||||
});
|
||||
|
||||
var summary = report.summary;
|
||||
Debug.Log(
|
||||
"WINDOWS_BUILD result=" + summary.result
|
||||
+ " size=" + summary.totalSize
|
||||
+ " errors=" + summary.totalErrors
|
||||
+ " output=" + output);
|
||||
|
||||
if (summary.result != BuildResult.Succeeded)
|
||||
{
|
||||
Debug.LogError("Windows build failed: " + summary.result);
|
||||
if (cli)
|
||||
EditorApplication.Exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cli)
|
||||
EditorApplication.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4c6aa452fe07ed43a219a709d35de64
|
||||
|
|
@ -183,6 +183,8 @@ namespace Vanguard.App
|
|||
var shader = Shader.Find("Universal Render Pipeline/Lit");
|
||||
if (shader == null)
|
||||
shader = Shader.Find("Standard");
|
||||
if (shader == null)
|
||||
return;
|
||||
|
||||
var material = new Material(shader);
|
||||
if (material.HasProperty("_BaseColor"))
|
||||
|
|
|
|||
|
|
@ -84,6 +84,8 @@ namespace Vanguard.Board3D
|
|||
shader = Shader.Find("Sprites/Default");
|
||||
if (shader == null)
|
||||
shader = Shader.Find("Standard");
|
||||
if (shader == null)
|
||||
return null;
|
||||
|
||||
var material = new Material(shader)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ GraphicsSettings:
|
|||
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
- {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, type: 3}
|
||||
m_PreloadedShaders: []
|
||||
m_PreloadShadersBatchTimeLimit: -1
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
|
|
|
|||
|
|
@ -962,3 +962,19 @@ Battle; Boot и общие сервисы остаются персистент
|
|||
`PLAYMAT_SMOKE success=True cards=25 hand=5/5 fieldVisible=True`.
|
||||
- Дальше: только 3D-модели/наполнение сцен, анимации retire/ghost и
|
||||
декбилдер; prefab-оверлеи и раскладка закрыты.
|
||||
|
||||
## 2026-10-23 — Windows standalone
|
||||
|
||||
- Добавлен `StandaloneBuild`: меню `Vanguard → Build Windows Standalone` и
|
||||
CLI `-executeMethod Vanguard.Editor.StandaloneBuild.BuildWindowsCli`.
|
||||
Собирает все включённые сцены в `client/Builds/Windows/VanguardReMaster.exe`
|
||||
(папка в `.gitignore`).
|
||||
- В `GraphicsSettings.m_AlwaysIncludedShaders` добавлены URP Lit/Unlit,
|
||||
чтобы runtime-материалы `SceneEnvironment`/`BoardMaterials` не теряли
|
||||
шейдеры при сборке. `Paint`/`CreateUnlit` теперь безопасны при
|
||||
отсутствующем шейдере.
|
||||
- Проверка сборки: Windows x64 build succeeded; при запуске с реальным
|
||||
D3D12-устройством исключений нет. `-nographics` для этого приложения
|
||||
не показателен: runtime-материалы требуют графического устройства.
|
||||
- Сервер для standalone по умолчанию — `http://192.168.31.158:18080`;
|
||||
его нужно поднять/держать доступным.
|
||||
|
|
|
|||
|
|
@ -143,6 +143,19 @@ curl http://127.0.0.1:18080/health
|
|||
2. Открыть `Assets/Scenes/Boot.unity`, Play.
|
||||
3. Стенд по умолчанию — `http://192.168.31.158:18080`.
|
||||
|
||||
Standalone Windows:
|
||||
|
||||
- В редакторе: `Vanguard → Build Windows Standalone`.
|
||||
- Из CLI (пример для копии проекта):
|
||||
```powershell
|
||||
& 'C:\Program Files\Unity\Hub\Editor\6000.6.6f1\Editor\Unity.exe' `
|
||||
-batchmode -nographics -projectPath client `
|
||||
-executeMethod Vanguard.Editor.StandaloneBuild.BuildWindowsCli -quit
|
||||
```
|
||||
- Результат: `client/Builds/Windows/VanguardReMaster.exe` (папка в
|
||||
`.gitignore`). Это обычное приложение, не Play Mode; сервер должен быть
|
||||
доступен по адресу из `AppConfig`.
|
||||
|
||||
## Проверки клиента
|
||||
|
||||
```powershell
|
||||
|
|
@ -204,6 +217,7 @@ client/Assets/Vanguard/Runtime/UI/Overlays/
|
|||
OverlayPrefabs.cs загрузка prefab-оверлеев
|
||||
client/Assets/Vanguard/Editor/
|
||||
OverlayPrefabBuilder.cs сборка Resources/Overlays/*.prefab
|
||||
StandaloneBuild.cs Windows standalone build
|
||||
client/Assets/Vanguard/Runtime/Battle/
|
||||
AnimationConfig.cs длительности/скорости анимаций
|
||||
InputLockService.cs блокировка ввода по причинам
|
||||
|
|
|
|||
Loading…
Reference in New Issue