using UnityEngine; public class MonoBehaviourSingletonTemplate : MyCoroutine where T : MyCoroutine { public static T Ins; public GameObject go_child; protected virtual void Awake() { Ins = this as T; if (go_child) go_child.SetActive(false); } protected void DontDestroy() { if (transform.parent == null) DontDestroyOnLoad(gameObject); } public bool IsActive() { return go_child && go_child.activeSelf; } public void On() { if (go_child) go_child.SetActive(true); else gameObject.SetActive(true); } public virtual void Off() { if (go_child) go_child.SetActive(false); else gameObject.SetActive(false); } } public class MonoBehaviourSingletonuScrollViewMgr : uScrollViewMgr where T : MonoBehaviour { public static T Ins; protected override void Awake() { Ins = this as T; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } } public class MonoBehaviourSingletonTemplateBackKeyAdd : BackKeyAdd where T : MonoBehaviour { public static T Ins; protected override void Awake() { Ins = this as T; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } }