25 lines
768 B
C#
25 lines
768 B
C#
|
|
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); }
|
||
|
|
}
|