fix: widen note lanes and clear warnings
This commit is contained in:
@@ -17,7 +17,7 @@ public class DesktopUIMode : MonoBehaviour
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||||
private static void AutoCreate()
|
||||
{
|
||||
if (FindObjectOfType<DesktopUIMode>() != null) return;
|
||||
if (FindFirstObjectByType<DesktopUIMode>() != null) return;
|
||||
new GameObject("[DesktopUIMode]").AddComponent<DesktopUIMode>();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class DesktopUIMode : MonoBehaviour
|
||||
if (cam == null)
|
||||
foreach (var c in FindObjectsByType<Camera>(FindObjectsSortMode.None))
|
||||
if (c.enabled && c.gameObject.scene.name != "DontDestroyOnLoad") { cam = c; break; }
|
||||
cam ??= FindObjectOfType<Camera>();
|
||||
cam ??= FindFirstObjectByType<Camera>();
|
||||
if (cam == null) return;
|
||||
|
||||
foreach (var canvas in FindObjectsByType<Canvas>(FindObjectsSortMode.None))
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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<AudioManager>();
|
||||
_audio = FindFirstObjectByType<AudioManager>();
|
||||
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 =
|
||||
|
||||
@@ -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<MarqueeText>();
|
||||
|
||||
// Artist
|
||||
|
||||
Reference in New Issue
Block a user