将Spline移出Plugin,以调整SplineRenderer的OnWillCameraRender
This commit is contained in:
21
Assets/Dreamteck/Utilities/Singleton.cs
Normal file
21
Assets/Dreamteck/Utilities/Singleton.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
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.FindObjectsOfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user