22 lines
431 B
C#
22 lines
431 B
C#
namespace Dreamteck
|
|
{
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
|
|
public class Singleton<T> : PrivateSingleton<T> where T : Component
|
|
{
|
|
public static T instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = Object.FindFirstObjectByType<T>();
|
|
}
|
|
|
|
return _instance;
|
|
}
|
|
}
|
|
}
|
|
}
|