From 58c88dafff14a0a0aa708960f9b56b06569596d3 Mon Sep 17 00:00:00 2001 From: jongjae Date: Fri, 22 May 2026 01:22:16 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20SongSelect=20panel=20=E2=80=94=20NAS=20?= =?UTF-8?q?song=20list=20with=20download/play=20in=20Menu.unity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add DownloadManager, SongLibrary, SongSelectManager, SongDetailPanel scripts - Rebuild SongSelect panel inside Menu.unity using VRBeatsKit style: left scroll list (ALL/OWNED tabs) + right detail panel (diff buttons, Download/Delete/Play) - SceneBuilder replaced: only ③ Menu — Rebuild SongSelect Panel remains - All UI text in English Co-Authored-By: Claude Sonnet 4.6 --- Assets/Editor/VRBeatSaberSceneBuilder.cs | 703 ++- Assets/Script/DownloadManager.cs | 160 + Assets/Script/DownloadManager.cs.meta | 2 + Assets/Script/SongDetailPanel.cs | 230 + Assets/Script/SongDetailPanel.cs.meta | 2 + Assets/Script/SongLibrary.cs | 140 + Assets/Script/SongLibrary.cs.meta | 2 + Assets/Script/SongSelectManager.cs | 200 + Assets/Script/SongSelectManager.cs.meta | 2 + Assets/VRBeatsKit/Scenes/Menu.unity | 4971 ++++++++++++++++++++- ProjectSettings/EditorBuildSettings.asset | 4 + 11 files changed, 5857 insertions(+), 559 deletions(-) create mode 100644 Assets/Script/DownloadManager.cs create mode 100644 Assets/Script/DownloadManager.cs.meta create mode 100644 Assets/Script/SongDetailPanel.cs create mode 100644 Assets/Script/SongDetailPanel.cs.meta create mode 100644 Assets/Script/SongLibrary.cs create mode 100644 Assets/Script/SongLibrary.cs.meta create mode 100644 Assets/Script/SongSelectManager.cs create mode 100644 Assets/Script/SongSelectManager.cs.meta diff --git a/Assets/Editor/VRBeatSaberSceneBuilder.cs b/Assets/Editor/VRBeatSaberSceneBuilder.cs index cf80095..d03077a 100644 --- a/Assets/Editor/VRBeatSaberSceneBuilder.cs +++ b/Assets/Editor/VRBeatSaberSceneBuilder.cs @@ -1,281 +1,316 @@ using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine; -using UnityEngine.Rendering; using UnityEngine.UI; using TMPro; public static class VRBeatSaberSceneBuilder { - private const string MenuScene = "Assets/VRBeatsKit/Scenes/Menu.unity"; - private const string SongCreatorDest = "Assets/Scenes/SongCreator.unity"; + private const string MenuScene = "Assets/VRBeatsKit/Scenes/Menu.unity"; // ───────────────────────────────────────────── - // ⓪ Fix — Set Graphics API to D3D11 (Oculus requirement) + // ③ Menu — Rebuild SongSelect Panel + // + // Canvas(SongSelect) size: 105.885 × 68.223 + // BG child covers full canvas (stretch anchors) + // BG local coord origin = center + // X: -52.94 ~ +52.94 + // Y: -34.11 ~ +34.11 // ───────────────────────────────────────────── - [MenuItem("Tools/VRBeatSaber/⓪ Fix — Set Graphics API to D3D11")] - public static void FixGraphicsAPI() - { - var d3d11 = new[] { GraphicsDeviceType.Direct3D11 }; - - PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.StandaloneWindows, false); - PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.StandaloneWindows64, false); - PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneWindows, d3d11); - PlayerSettings.SetGraphicsAPIs(BuildTarget.StandaloneWindows64, d3d11); - - Debug.Log("[SceneBuilder] ✓ Graphics API set to Direct3D11 for Windows."); - } - - [MenuItem("Tools/VRBeatSaber/⓪ Fix — Allow HTTP connections")] - public static void FixAllowHttp() - { - PlayerSettings.insecureHttpOption = InsecureHttpOption.AlwaysAllowed; - Debug.Log("[SceneBuilder] ✓ Insecure HTTP connections allowed."); - } - - // ───────────────────────────────────────────── - // Fix — Remove missing script components from open scene - // ───────────────────────────────────────────── - [MenuItem("Tools/VRBeatSaber/Fix — Remove Missing Scripts (open scene)")] - public static void RemoveMissingScripts() - { - int removed = 0; - foreach (var go in Object.FindObjectsByType(FindObjectsSortMode.None)) - { - var so = new SerializedObject(go); - var components = so.FindProperty("m_Component"); - for (int i = components.arraySize - 1; i >= 0; i--) - { - var comp = components.GetArrayElementAtIndex(i) - .FindPropertyRelative("component") - .objectReferenceValue; - if (comp == null) - { - components.DeleteArrayElementAtIndex(i); - removed++; - } - } - so.ApplyModifiedPropertiesWithoutUndo(); - } - - var activeScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); - EditorSceneManager.MarkSceneDirty(activeScene); - Debug.Log($"[SceneBuilder] ✓ Removed {removed} missing script(s) from '{activeScene.name}'."); - } - - // ───────────────────────────────────────────── - // ① Menu — Add Song Creator Button - // ───────────────────────────────────────────── - [MenuItem("Tools/VRBeatSaber/① Menu — Add Song Creator Button")] - public static void PatchMenuAddSongCreatorButton() + [MenuItem("Tools/VRBeatSaber/③ Menu — Rebuild SongSelect Panel")] + public static void RebuildSongSelectPanel() { var scene = EditorSceneManager.OpenScene(MenuScene, OpenSceneMode.Single); - var settings = GameObject.Find("Settings"); - if (settings == null) { Debug.LogError("[SceneBuilder] 'Settings' not found."); return; } + var songSelectGO = GameObject.Find("SongSelect"); + if (songSelectGO == null) { Debug.LogError("[SceneBuilder] 'SongSelect' not found."); return; } - if (settings.transform.Find("BG/Song Creator") != null) - { Debug.LogWarning("[SceneBuilder] Button already exists."); return; } + var bgTransform = songSelectGO.transform.Find("BG"); + if (bgTransform == null) { Debug.LogError("[SceneBuilder] 'SongSelect/BG' not found."); return; } - var bg = settings.transform.Find("BG"); - if (bg == null) { Debug.LogError("[SceneBuilder] 'Settings/BG' not found."); return; } + // Clear BG children + for (int i = bgTransform.childCount - 1; i >= 0; i--) + Object.DestroyImmediate(bgTransform.GetChild(i).gameObject); - var btnGO = CreateStyledButton(bg, "Song Creator", new Vector2(0f, -20f), new Vector2(80f, 14f), 8f); - var loader = btnGO.AddComponent(); - InjectPrivate(loader, "button", btnGO.GetComponent