2025-06-03 02:42:28 -04:00
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Ichni.RhythmGame;
|
2025-07-08 14:28:40 -04:00
|
|
|
using Ichni.RhythmGame.UI;
|
2025-06-03 02:42:28 -04:00
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using UnityEngine;
|
2025-07-21 05:42:20 -04:00
|
|
|
using UnityEngine.SceneManagement;
|
2025-08-11 14:04:06 -04:00
|
|
|
using UnityEngine.Serialization;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
namespace Ichni
|
|
|
|
|
{
|
2025-07-21 05:42:20 -04:00
|
|
|
public partial class GameManager : SerializedMonoBehaviour
|
2025-06-03 02:42:28 -04:00
|
|
|
{
|
|
|
|
|
public static GameManager instance;
|
|
|
|
|
|
|
|
|
|
public AudioManager audioManager;
|
|
|
|
|
|
|
|
|
|
public CameraManager cameraManager;
|
|
|
|
|
|
2025-08-11 14:04:06 -04:00
|
|
|
[FormerlySerializedAs("inputManager")] public NoteJudgeManager noteJudgeManager;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
|
|
|
|
public BackgroundSetter backgroundSetter;
|
|
|
|
|
public BackgroundController backgroundController;
|
|
|
|
|
|
|
|
|
|
public VariablesContainer variablesContainer;
|
|
|
|
|
|
|
|
|
|
public PostProcessingManager postProcessingManager;
|
|
|
|
|
|
|
|
|
|
public ProjectLoader projectLoader;
|
|
|
|
|
public PlayingRecorder playingRecorder;
|
|
|
|
|
|
|
|
|
|
public BeatmapContainer beatmapContainer;
|
|
|
|
|
public CommandScripts commandScripts;
|
|
|
|
|
public ProjectInformation projectInformation;
|
|
|
|
|
public SongInformation songInformation;
|
|
|
|
|
|
2025-07-21 05:42:20 -04:00
|
|
|
public NoteManager noteManager;
|
|
|
|
|
|
2025-06-03 02:42:28 -04:00
|
|
|
public BasePrefabsCollection basePrefabs;
|
2025-07-10 08:42:30 -04:00
|
|
|
public Dictionary<string, CustomPrefabsCollection> customPrefabs;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
2025-07-08 14:28:40 -04:00
|
|
|
[Title("UI")]
|
2025-06-03 02:42:28 -04:00
|
|
|
public Canvas judgeHintCanvas;
|
2025-07-08 14:28:40 -04:00
|
|
|
public GameUICanvas gameUICanvas;
|
|
|
|
|
public GameLoadingCanvas gameLoadingCanvas;
|
|
|
|
|
public SummaryPageCanvas summaryPageCanvas;
|
2025-06-03 02:42:28 -04:00
|
|
|
|
2025-08-11 14:04:06 -04:00
|
|
|
public float songTime => audioManager.isStarting ? 0 :
|
|
|
|
|
audioManager.songPlayer.songTimeSegment - songInformation.offset - (SettingsManager.instance.gameSettings.beatmapOffset / 1000f);
|
|
|
|
|
|
2025-06-03 02:42:28 -04:00
|
|
|
public bool isDebugging;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
instance = this;
|
|
|
|
|
playingRecorder = new PlayingRecorder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
2025-08-11 14:04:06 -04:00
|
|
|
basePrefabs.PrepareAudios();
|
2025-06-03 02:42:28 -04:00
|
|
|
projectLoader.TestLoad();
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-21 05:42:20 -04:00
|
|
|
|
|
|
|
|
public partial class GameManager
|
|
|
|
|
{
|
|
|
|
|
public static void RestartGame()
|
|
|
|
|
{
|
|
|
|
|
SceneManager.LoadScene("GameScene");
|
|
|
|
|
Time.timeScale = 1f; // 确保重启时时间缩放恢复正常
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void ReturnToMenu()
|
|
|
|
|
{
|
2025-09-06 21:58:48 -04:00
|
|
|
//InformationTransistor.instance.isReturnedFromGame = true;
|
2025-07-21 05:42:20 -04:00
|
|
|
SceneManager.LoadScene("MenuScene");
|
|
|
|
|
Time.timeScale = 1f; // 确保返回时时间缩放恢复正常
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-06-03 02:42:28 -04:00
|
|
|
}
|