临时提交

This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-21 20:02:19 +08:00
parent 930911e7df
commit e9c01842f0
206 changed files with 14468 additions and 21348 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Threading;
using GAS.Runtime;
using UnityEngine;
using UnityEngine.Profiling;
@@ -14,24 +15,31 @@ namespace GAS.General
public class JexGasObjectPool
{
private static JexGasObjectPool _singleton;
public static JexGasObjectPool Instance => _singleton ??= new JexGasObjectPool();
// private static JexGasObjectPool _singleton;
//
// public static JexGasObjectPool Instance => _singleton ??= new JexGasObjectPool();
public JexGasManager Manager;
public JexGasObjectPool(JexGasManager manager)
{
Manager = manager;
}
private readonly ConcurrentDictionary<Type, Pool> _objPool = new();
private readonly Func<Type, Pool> _addPoolFunc = type => new Pool(type, 1024);
public static void Awake()
{
_singleton = null;
_singleton = new JexGasObjectPool();
}
public static void Destroy()
{
_singleton = null;
}
// public static void Awake()
// {
// _singleton = null;
// _singleton = new JexGasObjectPool();
// }
//
// public static void Destroy()
// {
// _singleton = null;
// }
public T Fetch<T>() where T : class
{