mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
@@ -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);
|
Reference in New Issue
Block a user