This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-22 20:36:46 +08:00
parent 0e94e376fb
commit a3257421ad
26 changed files with 694 additions and 112 deletions

View File

@@ -37,14 +37,5 @@
// private static int _frameRate = 60;
// public static int FrameRate => _frameRate;
/// <summary>
///
/// </summary>
private static int _TimeLineAbilityTickTime = 20;
public static int TimeLineAbilityTickTime => _TimeLineAbilityTickTime;
public static int FrameRateValue => 1000 / _TimeLineAbilityTickTime;
}
}

View File

@@ -12,26 +12,13 @@ namespace GAS.General
bool IsFromPool { get; set; }
}
public class ObjectPool
public class JexGasObjectPool
{
private static ObjectPool _singleton;
public static ObjectPool Instance => _singleton ??= new ObjectPool();
private readonly ConcurrentDictionary<Type, Pool> _objPool = new();
private readonly Func<Type, Pool> _addPoolFunc = type => new Pool(type, 1024);
public static void Init()
{
_singleton = null;
_singleton = new ObjectPool();
}
public static void Destroy()
{
_singleton = null;
}
public T Fetch<T>() where T : class
{
var type = typeof(T);