初始化工程

This commit is contained in:
2025-07-15 15:33:35 +08:00
parent ead49da3e8
commit bbd78128d0
301 changed files with 23953 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
namespace CreatGame
{
public class Singleton<T> where T : class, new()
{
private static T _instance;
private static readonly object _lock = new object();
[UnityEngine.Scripting.Preserve]
protected Singleton()
{
}
/// <summary>
/// 单例对象(线程安全,双重锁定)
/// </summary>
[UnityEngine.Scripting.Preserve]
public static T Instance
{
get
{
if (_instance == null)
{
lock (_lock)
{
if (_instance == null)
{
_instance = new T();
}
}
}
return _instance;
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 06769352e6416554e8adc475a44e9d43
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: