2025-01-26 21:10:16 -05:00
|
|
|
namespace Dreamteck
|
|
|
|
|
{
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class Singleton<T> : PrivateSingleton<T> where T : Component
|
|
|
|
|
{
|
|
|
|
|
public static T instance
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_instance == null)
|
|
|
|
|
{
|
2026-07-17 21:09:34 +08:00
|
|
|
_instance = Object.FindFirstObjectByType<T>();
|
2025-01-26 21:10:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _instance;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-17 21:09:34 +08:00
|
|
|
}
|