48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class MonoBehaviourSingletonTemplate<T> : 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<T> : ScrollViewMgr where T : MonoBehaviour
|
|
{
|
|
public static T Ins;
|
|
|
|
protected override void Awake() { Ins = this as T; }
|
|
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
|
|
}
|
|
|
|
public class MonoBehaviourSingletonuScrollViewMgr<T> : uScrollViewMgr where T : MonoBehaviour
|
|
{
|
|
public static T Ins;
|
|
|
|
protected override void Awake() { Ins = this as T; }
|
|
protected void DontDestroy() { DontDestroyOnLoad(gameObject); }
|
|
}
|
|
|
|
public class MonoBehaviourSingletonuScrollViewArrMgr<T> : 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<T> : 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); }
|
|
} |