Shegotwet/Assets/Scripts/Util/MonoBehaviourSingletonTempl...

25 lines
768 B
C#
Raw Normal View History

2025-09-09 00:14:19 +00:00
using UnityEngine;
public class MonoBehaviourSingletonTemplate<T> : MyCoroutine where T : MyCoroutine
{
public static T Ins;
protected virtual void Awake() { Ins = this as T; }
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
}
public class MonoBehaviourSingletonTemplateBackKeyAdd<T> : BackKeyAdd where T : MonoBehaviour
{
public static T Ins;
protected override void Awake() { Ins = this as T; }
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
}
public class MonoBehaviourSingletonTemplateScrollView<T> : uScrollViewMgr where T : MonoBehaviour
{
public static T Ins;
protected override void Awake() { Ins = this as T; Init(); }
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
}