using System.Collections; using System.Collections.Generic; using UnityEngine; public class MonoBehaviourSingletonTemplate : MonoBehaviour where T : MonoBehaviour { public static T Ins; public static bool isIns; protected virtual void Awake() { Ins = this as T; isIns = true; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } } public class MonoBehaviourSingletonScrollViewMgr : ScrollViewMgr where T : MonoBehaviour { public static T Ins; protected override void Awake() { Ins = this as T; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } } 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 MonoBehaviourSingletonuScrollViewArrMgr : uScrollViewArrMgr where T : MonoBehaviour { public static T Ins; public static bool isIns; protected override void Awake() { Ins = this as T; isIns = true; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } } public class MonoBehaviourSingletonTemplateBackKeyAdd : BackKeyAdd where T : MonoBehaviour { public static T Ins; public GameObject go_Camera; protected override void Awake() { Ins = this as T; } protected void DontDestroy() { DontDestroyOnLoad(gameObject); } public void Camera_On() { if (go_Camera) go_Camera.SetActive(true); } public void Camera_Off() { if (go_Camera) go_Camera.SetActive(false); } }