using UnityEngine;
///
/// a singleton but as a MonoBehaviour
///
///
public class SingletonBehaviour : MonoBehaviour where T : SingletonBehaviour
{
public static T Instance
{
get;
private set;
}
protected virtual void Awake()
{
if (!Instance) Instance = this as T;
else Destroy(gameObject);
}
}