add the connection with the editor and can test the json now

This commit is contained in:
FloatGaming
2025-11-03 16:12:22 +08:00
parent 98510eef0f
commit 4ebe6183d3
57 changed files with 3287 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
using UnityEngine;
using System;
/// <summary>
/// Simple pause manager. Call Pause(true) to pause or Pause(false) to resume.
/// - overlayRoot: GameObject that will be enabled when paused and disabled when resumed.
/// - Pressing Escape toggles pause while the manager exists.
/// </summary>
public class PauseManager : MonoBehaviour
{
public static PauseManager Instance { get; private set; }
[Header("Overlay")]
public GameObject overlayRoot; // object to enable/disable on pause
public bool IsPaused { get; private set; } = false;
// Ìí¼ÓÔÝͣ״̬¸Ä±äʼþ
public event Action<bool> OnPauseStateChanged;
void Awake()
{
if (Instance == null) Instance = this;
else Destroy(gameObject);
}
void Start()
{
if (overlayRoot != null)
overlayRoot.SetActive(false);
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
TogglePause();
}
}
/// <summary>
/// Pause or resume the game. Call Pause(true) to pause.
/// This implementation enables/disables overlayRoot and sets Time.timeScale.
/// </summary>
public void Pause(bool pause)
{
if (pause)
{
if (IsPaused) return;
if (overlayRoot != null) overlayRoot.SetActive(true);
Time.timeScale = 0f;
IsPaused = true;
OnPauseStateChanged?.Invoke(true);
}
else
{
if (!IsPaused) return;
if (overlayRoot != null) overlayRoot.SetActive(false);
Time.timeScale = 1f;
IsPaused = false;
OnPauseStateChanged?.Invoke(false);
}
}
public void TogglePause()
{
Pause(!IsPaused);
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 56cb7fcf9dd21cf4fa4ffbc82abcc2b5
@@ -0,0 +1,8 @@
public static class GameConfig
{
// Toggle detailed logging for debugging. Keep false in production for performance.
public static bool verboseLogs = false;
// When true, gameplay will not automatically read JSON beatmaps on Start.
public static bool testMode = false;
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c21759aa6c9f44b4eb1beffb43a175a1
@@ -0,0 +1,11 @@
using UnityEngine;
namespace GamePlay
{
// Small marker for pooled objects to track their origin prefab and pool state
public class PoolItem : MonoBehaviour
{
public string prefabName;
public bool inPool = false;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 79493f118b699704ab6e5401229fe453