| 1234567891011121314151617181920 |
- using UnityEngine;
- /// <summary>
- /// µ¥Àý»ùÀ࣬¼Ì³Ðmono
- /// </summary>
- public class SingletonBaseMono<T> : MonoBehaviour where T : MonoBehaviour
- {
- private static T instance;
- public static T Instance
- {
- get
- {
- if (instance == null)
- {
- instance = GameObject.FindObjectOfType<T>();
- }
- return instance;
- }
- }
- }
|