diff --git a/Assets/Editor/VRBeatSaberSceneBuilder.cs b/Assets/Editor/VRBeatSaberSceneBuilder.cs index 24d5a48..8e3dc56 100644 --- a/Assets/Editor/VRBeatSaberSceneBuilder.cs +++ b/Assets/Editor/VRBeatSaberSceneBuilder.cs @@ -35,7 +35,7 @@ public static class VRBeatSaberSceneBuilder var scene = EditorSceneManager.OpenScene(gamePath, OpenSceneMode.Single); // PlayableManager 제거 (PlayableDirector는 유지) - var pm = Object.FindObjectOfType(); + var pm = Object.FindFirstObjectByType(); if (pm != null) Object.DestroyImmediate(pm); diff --git a/Assets/Script/DesktopUIMode.cs b/Assets/Script/DesktopUIMode.cs index 504b4f6..98268d3 100644 --- a/Assets/Script/DesktopUIMode.cs +++ b/Assets/Script/DesktopUIMode.cs @@ -17,7 +17,7 @@ public class DesktopUIMode : MonoBehaviour [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)] private static void AutoCreate() { - if (FindObjectOfType() != null) return; + if (FindFirstObjectByType() != null) return; new GameObject("[DesktopUIMode]").AddComponent(); } @@ -92,7 +92,7 @@ public class DesktopUIMode : MonoBehaviour if (cam == null) foreach (var c in FindObjectsByType(FindObjectsSortMode.None)) if (c.enabled && c.gameObject.scene.name != "DontDestroyOnLoad") { cam = c; break; } - cam ??= FindObjectOfType(); + cam ??= FindFirstObjectByType(); if (cam == null) return; foreach (var canvas in FindObjectsByType(FindObjectsSortMode.None)) diff --git a/Assets/Script/NasPublisher.cs b/Assets/Script/NasPublisher.cs index 944e21c..efe5022 100644 --- a/Assets/Script/NasPublisher.cs +++ b/Assets/Script/NasPublisher.cs @@ -37,11 +37,11 @@ public class NasPublisher : MonoBehaviour [Serializable] private class NasConfig { - public string host; - public string account; - public string rootPath; - public string staticUrl; - public string password; + public string host = ""; + public string account = ""; + public string rootPath = ""; + public string staticUrl = ""; + public string password = ""; } public IEnumerator Publish( diff --git a/Assets/Script/SongController.cs b/Assets/Script/SongController.cs index b81685d..fcae659 100644 --- a/Assets/Script/SongController.cs +++ b/Assets/Script/SongController.cs @@ -13,6 +13,11 @@ public class SongController : MonoBehaviour [SerializeField] private GameEvent onLevelComplete; [SerializeField] private TMP_Text countdownText; + private const float LaneSpacing = 0.42f; + private const float LayerSpacing = 0.38f; + private const float HorizontalCenter = 1.5f; + private const float VerticalCenter = 1f; + private AudioManager _audio; private static string CacheRoot => @@ -20,7 +25,7 @@ public class SongController : MonoBehaviour private void Start() { - _audio = FindObjectOfType(); + _audio = FindFirstObjectByType(); StartCoroutine(LoadAndPlay()); } @@ -68,7 +73,7 @@ public class SongController : MonoBehaviour Debug.LogError("[SongController] Map parse failed"); yield break; } - map.target.Sort((a, b) => a.time.CompareTo(b.time)); + map.target.Sort(CompareNotes); yield return StartCoroutine(Countdown()); @@ -109,8 +114,8 @@ public class SongController : MonoBehaviour private void SpawnNote(NoteData note) { - float x = -0.375f + note.position * 0.25f; - float y = -0.333f + note.lineLayer * 0.333f; + float x = MapLaneX(note.position); + float y = MapLayerY(note.lineLayer); // 스폰 시점의 실제 남은 시간으로 역산 → 동시 노트가 프레임 차이 나도 같은 타이밍에 도착 float remaining = note.time - _audio.CurrentTime; @@ -129,6 +134,31 @@ public class SongController : MonoBehaviour VR_BeatManager.instance.Spawn(cubePrefab, info); } + private static int CompareNotes(NoteData a, NoteData b) + { + int timeCompare = a.time.CompareTo(b.time); + if (timeCompare != 0) + return timeCompare; + + int positionCompare = a.position.CompareTo(b.position); + if (positionCompare != 0) + return positionCompare; + + return a.lineLayer.CompareTo(b.lineLayer); + } + + private static float MapLaneX(int position) + { + int lane = Mathf.Clamp(position, 0, 3); + return (lane - HorizontalCenter) * LaneSpacing; + } + + private static float MapLayerY(int lineLayer) + { + int layer = Mathf.Clamp(lineLayer, 0, 2); + return (layer - VerticalCenter) * LayerSpacing; + } + // Beat Saber cutDirection → VRBeats Direction // BS: 0=Up 1=Down 2=Left 3=Right 4=UpperLeft 5=UpperRight 6=LowerLeft 7=LowerRight 8=Any private static readonly Direction[] CutDirMap = diff --git a/Assets/Script/SongSelectManager.cs b/Assets/Script/SongSelectManager.cs index 84a91da..14efa34 100644 --- a/Assets/Script/SongSelectManager.cs +++ b/Assets/Script/SongSelectManager.cs @@ -159,7 +159,7 @@ public class SongSelectManager : MonoBehaviour tTmp.color = Color.white; tTmp.alignment = TextAlignmentOptions.MidlineLeft; tTmp.overflowMode = TextOverflowModes.Overflow; - tTmp.enableWordWrapping = false; + tTmp.textWrappingMode = TextWrappingModes.NoWrap; titleGO.AddComponent(); // Artist diff --git a/Assets/VRBeatsKit/Modules/VRDamageSystem/DamageableManagerAI.cs b/Assets/VRBeatsKit/Modules/VRDamageSystem/DamageableManagerAI.cs index fa6cf4a..34da2c0 100644 --- a/Assets/VRBeatsKit/Modules/VRDamageSystem/DamageableManagerAI.cs +++ b/Assets/VRBeatsKit/Modules/VRDamageSystem/DamageableManagerAI.cs @@ -11,7 +11,7 @@ namespace DamageSystem OnDamage.AddListener( ApplyImpactForce ); } - private void ApplyImpactForce(DamageInfo info, DamageablePart damageable) + protected override void ApplyImpactForce(DamageInfo info, DamageablePart damageable) { //if this AI if no dead it is being controlled by the Animator so dont apply any impact force if (!IsDead) @@ -28,4 +28,3 @@ namespace DamageSystem } } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbPoint.cs b/Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbPoint.cs index 10ebbae..a67d1cd 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbPoint.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbPoint.cs @@ -14,7 +14,7 @@ namespace VRSDK.Climbing { base.Start(); - target = FindObjectOfType(); + target = FindFirstObjectByType(); onGrabStateChange.AddListener( OnGrabStateChangeClimb ); } @@ -89,4 +89,3 @@ namespace VRSDK.Climbing } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Editor/I_VR_ManagerInspector.cs b/Assets/VRBeatsKit/Modules/VRSDK/Editor/I_VR_ManagerInspector.cs index 02763bb..61d0ddb 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Editor/I_VR_ManagerInspector.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Editor/I_VR_ManagerInspector.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEditor; +using UnityEditor.Build; using System.Collections.Generic; using System.IO; using System.Linq; @@ -193,8 +194,8 @@ namespace VRSDK.EditorCode public static void ForceRebuild() { string[] rebuildSymbols = { "RebuildToggle1", "RebuildToggle2" }; - string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup( - EditorUserBuildSettings.selectedBuildTargetGroup ); + NamedBuildTarget buildTarget = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup); + string definesString = PlayerSettings.GetScriptingDefineSymbols(buildTarget); var definesStringTemp = definesString; if (definesStringTemp.Contains( rebuildSymbols[0] )) { @@ -208,14 +209,9 @@ namespace VRSDK.EditorCode { definesStringTemp += ";" + rebuildSymbols[0]; } - PlayerSettings.SetScriptingDefineSymbolsForGroup( - EditorUserBuildSettings.selectedBuildTargetGroup, - definesStringTemp ); - PlayerSettings.SetScriptingDefineSymbolsForGroup( - EditorUserBuildSettings.selectedBuildTargetGroup, - definesString ); + PlayerSettings.SetScriptingDefineSymbols(buildTarget, definesStringTemp); + PlayerSettings.SetScriptingDefineSymbols(buildTarget, definesString); } } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/Editor/I_HandVisualizerTool.cs b/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/Editor/I_HandVisualizerTool.cs index b3cc33a..73fac03 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/Editor/I_HandVisualizerTool.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/Editor/I_HandVisualizerTool.cs @@ -15,10 +15,6 @@ namespace VRSDK.EditorCode private HandVisualizerTool targetScript = null; - private static string returnScenePath = null; - private static Scene returnScene; - private static bool inPreviewMode = false; - private void Awake() { /* @@ -95,4 +91,3 @@ namespace VRSDK.EditorCode } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/HandPreviewManager.cs b/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/HandPreviewManager.cs index e5a93a8..72f31e0 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/HandPreviewManager.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Experimental/Tools/HandVisualizer/HandPreviewManager.cs @@ -26,15 +26,15 @@ namespace VRSDK.EditorCode { Scene originalScene = EditorSceneManager.GetActiveScene(); - originalScenePath = EditorApplication.currentScene; + originalScenePath = originalScene.path; Scene previewScene = EditorSceneManager.NewScene( NewSceneSetup.DefaultGameObjects, NewSceneMode.Additive ); EditorSceneManager.MoveGameObjectToScene( clone, previewScene ); EditorSceneManager.UnloadSceneAsync( originalScene ); previewModeEnable = true; - inspectedGrabbable = GameObject.FindObjectOfType(); - activeController = GameObject.FindObjectOfType(); + inspectedGrabbable = GameObject.FindFirstObjectByType(); + activeController = GameObject.FindFirstObjectByType(); OverrideGrabAnimation(); @@ -55,7 +55,7 @@ namespace VRSDK.EditorCode { handPreviewSave = new HandPreviewSave( inspectedGrabbable ); ExitPreviewMode(); - GameObjectMarker marker = GameObject.FindObjectOfType(); + GameObjectMarker marker = GameObject.FindFirstObjectByType(); handPreviewSave.LoadInto(marker.GetComponent()); GameObject.DestroyImmediate(marker); } @@ -131,4 +131,3 @@ namespace VRSDK.EditorCode } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Other/DemoScene.cs b/Assets/VRBeatsKit/Modules/VRSDK/Other/DemoScene.cs index 2e93a43..7999f7f 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Other/DemoScene.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Other/DemoScene.cs @@ -23,7 +23,7 @@ namespace VRSDK private void Start() { - Player player = FindObjectOfType(); + Player player = FindFirstObjectByType(); gameOverScreenFader = player.GameOverScreenFader; } @@ -123,4 +123,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Other/PlayerPockets.cs b/Assets/VRBeatsKit/Modules/VRSDK/Other/PlayerPockets.cs index 9d22452..fcda890 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Other/PlayerPockets.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Other/PlayerPockets.cs @@ -16,7 +16,7 @@ namespace VRSDK private void Start() { - characterController = FindObjectOfType(); + characterController = FindFirstObjectByType(); if (characterController != null) { @@ -25,7 +25,7 @@ namespace VRSDK if (anchorPoint == null) { - Player player = FindObjectOfType(); + Player player = FindFirstObjectByType(); anchorPoint = player.PocketsAnchorPoint; } @@ -36,7 +36,7 @@ namespace VRSDK private void SetTeleportCallback() { - VR_TeleportHandler teleportHandler = FindObjectOfType(); + VR_TeleportHandler teleportHandler = FindFirstObjectByType(); if (teleportHandler != null) { @@ -102,4 +102,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Other/Singleton.cs b/Assets/VRBeatsKit/Modules/VRSDK/Other/Singleton.cs index 964d06a..772d23f 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Other/Singleton.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Other/Singleton.cs @@ -22,7 +22,7 @@ namespace Platinio { //get all the singletones - T[] singletons = GameObject.FindObjectsOfType( typeof(T) ) as T[]; + T[] singletons = FindObjectsByType(FindObjectsSortMode.None); if(singletons != null) { diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCube.cs b/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCube.cs index 0b526ce..bd7b4d8 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCube.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCube.cs @@ -18,10 +18,9 @@ namespace VRSDK { for (int n = 0; n < wallCubePartArray.Length; n++) { - wallCubePartArray[n].Reset( resetTime ); + wallCubePartArray[n].ResetPart( resetTime ); } } } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCubePart.cs b/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCubePart.cs index 807096d..17ce231 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCubePart.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Other/WallCubePart.cs @@ -17,7 +17,7 @@ namespace VRSDK rb = GetComponent(); } - public void Reset(float t) + public void ResetPart(float t) { rb.isKinematic = true; @@ -64,4 +64,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/Physics/HandPhysics.cs b/Assets/VRBeatsKit/Modules/VRSDK/Physics/HandPhysics.cs index 44090a9..998fe11 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/Physics/HandPhysics.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/Physics/HandPhysics.cs @@ -49,7 +49,7 @@ namespace VRSDK public HandPhysics(HistoryBuffer buffer) { historyBuffer = buffer; - characterController = MonoBehaviour.FindObjectOfType(); + characterController = MonoBehaviour.FindFirstObjectByType(); trackingSpace = VR_Manager.instance.Player.TrackingSpace; @@ -148,4 +148,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/Input/VR_XRInput.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/Input/VR_XRInput.cs index b2e24f7..73dfb6c 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/Input/VR_XRInput.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/Input/VR_XRInput.cs @@ -95,17 +95,17 @@ namespace VRSDK return GetAxis1D(button) > 0.25f; case VR_InputButton.Primary: #if UNITY_XR - thisInputDevice.IsPressed(InputHelpers.Button.PrimaryButton, out value); + thisInputDevice.TryGetFeatureValue(CommonUsages.primaryButton, out value); #endif break; case VR_InputButton.Secondary: #if UNITY_XR - thisInputDevice.IsPressed(InputHelpers.Button.SecondaryButton, out value); + thisInputDevice.TryGetFeatureValue(CommonUsages.secondaryButton, out value); #endif break; case VR_InputButton.TumbstickPress: #if UNITY_XR - thisInputDevice.IsPressed(InputHelpers.Button.Primary2DAxisClick, out value); + thisInputDevice.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out value); #endif break; } @@ -158,4 +158,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/Teleporting/VR_AimMarker.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/Teleporting/VR_AimMarker.cs index 2764fd2..ec77798 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/Teleporting/VR_AimMarker.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/Teleporting/VR_AimMarker.cs @@ -1,16 +1,19 @@ using UnityEngine; +using UnityEngine.Serialization; + namespace VRSDK.Locomotion { //this scripts handles aim marker position and rotation public class VR_AimMarker : MonoBehaviour { [SerializeField] private GameObject marker = null; - [SerializeField] private BoxCollider collider = null; + [FormerlySerializedAs("collider")] + [SerializeField] private BoxCollider markerCollider = null; [SerializeField] private float slopeLimit; public GameObject Marker { get { return marker; } } - public BoxCollider Collider { get { return collider; } } + public BoxCollider Collider { get { return markerCollider; } } public float SlopeLimit { get { return slopeLimit; } } private void Awake() @@ -52,4 +55,3 @@ namespace VRSDK.Locomotion } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_CharacterController.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_CharacterController.cs index 3ade99e..e54d698 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_CharacterController.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_CharacterController.cs @@ -88,11 +88,13 @@ namespace VRSDK [NonSerialized] public float CameraHeight; +#if SDK_OCULUS /// /// This event is raised after the character controller is moved. This is used by the OVRAvatarLocomotion script to keep the avatar transform synchronized /// with the OVRPlayerController. /// public event Action TransformUpdated; +#endif /// /// This bool is set to true whenever the player controller has been teleported. It is reset after every frame. Some systems, such as @@ -177,7 +179,9 @@ namespace VRSDK private float SimulationRate = 60f; private float buttonRotation = 0f; private bool ReadyToSnapTurn; // Set to true when a snap turn has occurred, code requires one frame of centered thumbstick to enable another snap turn. +#if SDK_OCULUS private bool playerControllerEnabled = false; +#endif private float moveInfluence = 0.0f; public Vector3 lastPosition = Vector3.zero; private Vector3 velocity = Vector3.zero; @@ -409,8 +413,6 @@ namespace VRSDK moveRight = Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow); moveBack = Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow); #endif - bool dpad_move = false; - MoveScale = 1.0f; if ((moveForward && moveLeft) || (moveForward && moveRight) || (moveBack && moveLeft) || (moveBack && moveRight)) @@ -427,6 +429,7 @@ namespace VRSDK // Run! #if !UNITY_XR + bool dpad_move = false; if (dpad_move || Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) moveInfluence *= 2.0f; #endif @@ -713,4 +716,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Controller.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Controller.cs index 7c25462..2d5e58e 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Controller.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Controller.cs @@ -172,7 +172,7 @@ namespace VRSDK private void FindOrCreate_VR_Manager() { - if (FindObjectOfType() == null) + if (FindFirstObjectByType() == null) { Debug.LogError("you need a VR_Manager active in the scene in order to use VR Shooter Kit"); } @@ -630,4 +630,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_ControllerGesture.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_ControllerGesture.cs index ac0118c..b85a683 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_ControllerGesture.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_ControllerGesture.cs @@ -18,8 +18,6 @@ namespace VRSDK { private float minAcelerationThreshold = 0.0f; private float maxAcelerationThreshold = 0.0f; - private int sampleCount = 0; - private VR_Controller controller = null; private GesturePhase rotationGesturePhase = GesturePhase.Tracking; private Quaternion rotationGesturefromQuaternion = Quaternion.identity; @@ -128,4 +126,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Grabbable.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Grabbable.cs index 5184f30..2ce5f27 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Grabbable.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Grabbable.cs @@ -55,8 +55,6 @@ namespace VRSDK protected bool preventDefault = false; protected float velocityChangeThreshold = 10f; protected float angularVelocityChangeThreshold = 20f; - private bool previousUseGravityState = false; - private bool previousGravityState = false; private VR_Controller lastInteractController = null; private bool objectWasThrow = false; protected bool canUseDropZone = true; @@ -766,4 +764,4 @@ namespace VRSDK onGrabStateChange.RemoveAllListeners(); } } -} \ No newline at end of file +} diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Manager.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Manager.cs index a23da3a..5e9a6b4 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Manager.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Manager.cs @@ -34,6 +34,7 @@ namespace VRSDK #region PUBLIC public VR_SDK CurrentSDK { get { return currentSDK; } } + public ControllerGestureConfig GestureConfig { get { return gestureConfig; } } public List InteractList { get { return interactList; } } public List HighlightList { get { return highlightList; } } public List GrabbableList { get { return grabbableList; } } @@ -43,7 +44,7 @@ namespace VRSDK { if (player == null) { - player = FindObjectOfType(); + player = FindFirstObjectByType(); player.Construct(); } @@ -140,4 +141,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Player.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Player.cs index 89a4b4e..2d5d2d4 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Player.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Player.cs @@ -23,7 +23,7 @@ namespace VRSDK { get { - return FindObjectOfType(); + return FindFirstObjectByType(); } } @@ -109,4 +109,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Trowable.cs b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Trowable.cs index 4f102f1..610ce27 100644 --- a/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Trowable.cs +++ b/Assets/VRBeatsKit/Modules/VRSDK/VR/VR_Trowable.cs @@ -13,7 +13,6 @@ namespace VRSDK public float SpeedModifier { get { return speedModifier; } } public float AngularSpeedModifier { get { return aungularSpeedModifier; } } - bool throwed = false; private void Awake() { @@ -39,4 +38,3 @@ namespace VRSDK } } - diff --git a/Assets/VRBeatsKit/Scripts/Core/VR_BeatCube.cs b/Assets/VRBeatsKit/Scripts/Core/VR_BeatCube.cs index 0e0a27b..db0af7e 100644 --- a/Assets/VRBeatsKit/Scripts/Core/VR_BeatCube.cs +++ b/Assets/VRBeatsKit/Scripts/Core/VR_BeatCube.cs @@ -8,7 +8,6 @@ namespace VRBeats { [SerializeField] private float minCutSpeed = 0.5f; [SerializeField] private float maxCutAngle = 40f; - [SerializeField] private OnSliceAction sliceAction = null; [SerializeField] private GameEvent onCorrectSlice = null; [SerializeField] private GameEvent onIncorrectSlice = null; [SerializeField] private GameEvent onPlayerMiss = null; @@ -112,4 +111,3 @@ namespace VRBeats } } - diff --git a/Assets/VRBeatsKit/Scripts/Core/VR_BeatManager.cs b/Assets/VRBeatsKit/Scripts/Core/VR_BeatManager.cs index 4e933eb..8f7f8cf 100644 --- a/Assets/VRBeatsKit/Scripts/Core/VR_BeatManager.cs +++ b/Assets/VRBeatsKit/Scripts/Core/VR_BeatManager.cs @@ -11,8 +11,6 @@ namespace VRBeats [SerializeField] private BoxCollider playZone = null; [SerializeField] private Transform player = null; [SerializeField] private VR_BeatSettings settings = null; - [SerializeField] private GameEvent onGameOver = null; - private AudioManager audioManager = null; private EnviromentController enviromentController = null; private PlayableDirector playableDirector = null; @@ -24,20 +22,17 @@ namespace VRBeats public Transform Player { get { return player; } } - private int playerConsecutiveMiss = 0; - protected override void Awake() { base.Awake(); - audioManager = FindObjectOfType(); - enviromentController = FindObjectOfType(); - playableDirector = FindObjectOfType(); + audioManager = FindFirstObjectByType(); + enviromentController = FindFirstObjectByType(); + playableDirector = FindFirstObjectByType(); } protected override void Start() { base.Start(); - playerConsecutiveMiss = 0; } diff --git a/Assets/VRBeatsKit/Scripts/Other/RandomizeRotation.cs b/Assets/VRBeatsKit/Scripts/Other/RandomizeRotation.cs index 692e220..f9e8ea3 100644 --- a/Assets/VRBeatsKit/Scripts/Other/RandomizeRotation.cs +++ b/Assets/VRBeatsKit/Scripts/Other/RandomizeRotation.cs @@ -18,7 +18,8 @@ namespace VRBeats private void Rotate() { - float rotation = Random.Range(-maxRotation , maxRotation); + float direction = Random.value < 0.5f ? -1.0f : 1.0f; + float rotation = Random.Range(minRotation, maxRotation) * direction; transform.RotateTween( Vector3.forward , rotation , animTime).SetEase(ease).SetOnComplete( Rotate ); } diff --git a/Assets/VRBeatsKit/Scripts/Other/VolumeSingleton.cs b/Assets/VRBeatsKit/Scripts/Other/VolumeSingleton.cs index 9e0da45..350d64b 100644 --- a/Assets/VRBeatsKit/Scripts/Other/VolumeSingleton.cs +++ b/Assets/VRBeatsKit/Scripts/Other/VolumeSingleton.cs @@ -16,7 +16,7 @@ namespace VRBeats } else { - VolumeSingleton[] instancesArray = FindObjectsOfType(); + VolumeSingleton[] instancesArray = FindObjectsByType(FindObjectsSortMode.None); foreach (var volumeSingleton in instancesArray) { @@ -30,4 +30,3 @@ namespace VRBeats } } - diff --git a/Assets/VRBeatsKit/Scripts/PlatinioTween/Scripts/UI/RectTransformHelper.cs b/Assets/VRBeatsKit/Scripts/PlatinioTween/Scripts/UI/RectTransformHelper.cs index cafe2ee..0b2fb53 100644 --- a/Assets/VRBeatsKit/Scripts/PlatinioTween/Scripts/UI/RectTransformHelper.cs +++ b/Assets/VRBeatsKit/Scripts/PlatinioTween/Scripts/UI/RectTransformHelper.cs @@ -101,7 +101,7 @@ namespace Platinio.UI Canvas canvas = null; //just return the first encounter canvas - canvas = GameObject.FindObjectOfType(); + canvas = GameObject.FindFirstObjectByType(); if (canvas != null) { @@ -144,4 +144,3 @@ namespace Platinio.UI } } - diff --git a/Assets/VRBeatsKit/Scripts/TimeLine/VR_BeatSignalReceiver.cs b/Assets/VRBeatsKit/Scripts/TimeLine/VR_BeatSignalReceiver.cs index 1efd0bd..0200a0b 100644 --- a/Assets/VRBeatsKit/Scripts/TimeLine/VR_BeatSignalReceiver.cs +++ b/Assets/VRBeatsKit/Scripts/TimeLine/VR_BeatSignalReceiver.cs @@ -13,7 +13,7 @@ namespace VRBeats private void Awake() { - enviromentController = FindObjectOfType(); + enviromentController = FindFirstObjectByType(); } private void Update() diff --git a/Assets/VRBeatsKit/Scripts/UI/FinalScoreLabel.cs b/Assets/VRBeatsKit/Scripts/UI/FinalScoreLabel.cs index 8b41f54..a69d9fd 100644 --- a/Assets/VRBeatsKit/Scripts/UI/FinalScoreLabel.cs +++ b/Assets/VRBeatsKit/Scripts/UI/FinalScoreLabel.cs @@ -20,7 +20,7 @@ namespace VRBeats initialValue += "0"; } - scoreManager = FindObjectOfType(); + scoreManager = FindFirstObjectByType(); } @@ -58,4 +58,3 @@ namespace VRBeats } } - diff --git a/HANDOFF.md b/HANDOFF.md index e8a648b..628d619 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -14,8 +14,9 @@ Meta Quest용 VR Beat Saber 클론. Beat Sage API로 노래를 자동 채보하 - Unity 버전: `6000.3.12f1` - 현재 브랜치: `main` - 원격 저장소: `origin` = `https://whdwo798.synology.me/whdwo798/BeatSaber.git` -- 최근 푸시 커밋: `5e5e918 docs: update project handoff status` -- `dotnet build VRBeatSaber.slnx` 결과: 오류 0개, 경고 0개 +- 최근 푸시 커밋: `182d2c9 fix: stabilize VR UI and song playback` +- `dotnet build VRBeatSaber.slnx --no-incremental` 결과: 오류 0개, 경고 0개 +- 현재 워킹트리에는 큐브 간격 보정과 경고 제거 작업이 커밋 전 변경으로 남아 있다. ### 실제 씬 구성 @@ -53,6 +54,14 @@ SongCreator.unity ### 최근 반영된 변경 +- `Assets/Script/SongController.cs` + - Beat Saber 4라인 좌표 매핑을 넓혀 인접 큐브가 가로로 겹치는 문제를 줄였다. + - 기존 라인 x 좌표는 대략 `-0.375, -0.125, 0.125, 0.375`였고, 현재는 `-0.63, -0.21, 0.21, 0.63`이다. + - 맵 노트 정렬을 `time -> position -> lineLayer` 순서로 바꿔 같은 시간대 노트 처리 순서를 안정화했다. +- 전체 C# 경고 제거 + - `FindObjectOfType`, `FindObjectsOfType`, `InputHelpers`, `TMP_Text.enableWordWrapping`, `EditorApplication.currentScene`, 구버전 `PlayerSettings` API를 최신 API로 교체했다. + - 미사용 필드/변수, 상속 멤버 숨김, Unity 메시지 시그니처 경고를 정리했다. + - 최종 확인 빌드: `dotnet build VRBeatSaber.slnx --no-incremental` = 경고 0개, 오류 0개. - `Assets/Script/VRPointerController.cs`, `VRPointerSetup.cs` 추가 - VR 컨트롤러 레이로 Unity UI 버튼을 직접 hover/click 처리한다. - `Game` 씬에서는 게임오버 전까지 비활성화하고, 메뉴 계열 씬에서는 활성화한다. @@ -90,6 +99,8 @@ SongCreator.unity 3. `SongCreatorManager`는 난이도 토글 필드를 갖고 있지만 현재 로직은 4개 난이도(`normal`, `hard`, `expert`, `expertplus`)를 항상 전부 생성한다. 4. `manualEditorButton`은 씬에서 미연결이고 코드에서도 사용하지 않는다. 5. `Assets/img/360.mp4`는 약 192MB다. 현재 일반 Git으로 푸시되어 있으므로, 원격 정책이 바뀌면 Git LFS 전환을 검토해야 한다. +6. 큐브 간격은 수치상 겹침을 피하도록 넓혔지만, 실제 Quest 착용 테스트에서 손 위치/판정 거리/시야 피로도를 확인해야 한다. +7. SongCreator에서 생성 직후 첫 재생이 곡에 따라 늦거나 싱크가 흔들리는 체감이 있었다. 게임 씬 오디오 기준은 `AudioSettings.dspTime`으로 개선했지만, 생성/다운로드/첫 로드 전체 파이프라인은 추가 로그 검증이 필요하다. --- @@ -289,6 +300,9 @@ private IEnumerator LoadAndPlay() private void SpawnNote(NoteData note) { + float x = MapLaneX(note.position); + float y = MapLayerY(note.lineLayer); + var info = new SpawnEventInfo { position = new Vector3(x, y, 0f), @@ -305,6 +319,8 @@ private void SpawnNote(NoteData note) `travelTimeOverride`는 동시 노트가 프레임 차이로 스폰되어도 같은 타이밍에 도착하도록 `VR_BeatManager`에 추가된 값이다. +현재 라인 매핑은 `LaneSpacing = 0.42f`, `LayerSpacing = 0.38f`를 사용한다. 이는 VRBeatsKit 큐브 콜라이더의 실제 폭이 기존 라인 간격보다 커서 인접 라인이 겹치던 문제를 피하기 위한 값이다. + --- ## ScoreManager 충돌 없음 @@ -481,3 +497,5 @@ Application.temporaryCachePath/beatsaber/{songId}/ 3. **AudioType.MPEG**: MP3 로딩 시 `UnityWebRequestMultimedia.GetAudioClip(uri, AudioType.MPEG)` 사용. 4. **Unity `??` 연산자**: Unity Object에 `??` 쓰면 fake-null을 못 잡음. 반드시 `if (x == null)` 또는 `TryGetComponent` 사용. 5. **Build Settings 현재 상태**: 현재 등록 순서는 `Menu`, `BoxingStyle`, `SongCreator`, `SaberStyle`, `Game`이다. 예전 목표 설계의 `Intro`, `SongSelect`, `MapEditorScene`은 현재 Build Settings에 없다. +6. **경고 0 상태 유지**: 패키지 내부까지 경고를 제거해 둔 상태라, 새 SDK/API를 추가할 때 `dotnet build VRBeatSaber.slnx --no-incremental`로 경고 재발 여부를 확인한다. +7. **VR 실기 테스트 필수 항목**: 게임오버 Back/Retry 클릭, SongCreator UI 클릭, 큐브 가로 간격, 큐브 도착 싱크, 세이버 각도는 Quest에서 직접 확인해야 한다.