26 lines
494 B
C#
26 lines
494 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace ZXKFramework
|
|
{
|
|
public abstract class MonoSingleton<T> : MonoBehaviour where T : MonoBehaviour
|
|
{
|
|
private static T m_instance;
|
|
|
|
public static T Instance
|
|
{
|
|
get
|
|
{
|
|
return m_instance;
|
|
}
|
|
}
|
|
|
|
protected virtual void Awake()
|
|
{
|
|
m_instance = this as T;
|
|
}
|
|
}
|
|
}
|
|
|