using UnityEngine; namespace GameFramework { /// /// 场景级单例基类。每个场景里只存在一个实例,切场景后不保留。 /// public class Singleton : MonoBehaviour where T : Component { public static T Instance { get; private set; } protected virtual void Awake() { Instance = this as T; } } }