大修
This commit is contained in:
@@ -2,13 +2,15 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Sirenix.OdinInspector;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni
|
||||
{
|
||||
public class InformationTransistor : SerializedMonoBehaviour
|
||||
public class InformationTransistor : Singleton<InformationTransistor>
|
||||
{
|
||||
public static InformationTransistor instance;
|
||||
/// <summary>小写别名,兼容现有调用点</summary>
|
||||
public new static InformationTransistor instance => Instance;
|
||||
|
||||
public bool isLoadedProject;
|
||||
public string loadedProjectName;
|
||||
@@ -16,17 +18,9 @@ namespace Ichni
|
||||
public ProjectInformation_BM projectInfo_BM;
|
||||
public SongInformation_BM songInfo_BM;
|
||||
|
||||
private void Awake()
|
||||
protected override void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else if (instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
Initialize(true); // DontDestroyOnLoad 持久化单例
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user