增加A2WToolBox工具集,增加Launch场景核LaunchPanel
This commit is contained in:
25
Assets/A2WToolBox/Runtime/Singleton/SceneSingleton.cs
Normal file
25
Assets/A2WToolBox/Runtime/Singleton/SceneSingleton.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace A2W
|
||||
{
|
||||
public class SceneSingleton<T> : MonoBehaviour where T : MonoBehaviour
|
||||
{
|
||||
public static T instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = FindObjectOfType<T>();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
private static T _instance;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user