C# Class Hugula.Pool.PrefabPool

Inheritance: UnityEngine.MonoBehaviour
显示文件 Open project: tenvick/hugula Class Usage Examples

Public Properties

Property Type Description
gcDeltaTimeConfig float
threshold1 float
threshold2 float
threshold3 float

Public Methods

Method Description
Add ( string key, GameObject value, byte type ) : bool

添加原始缓存

Awake ( ) : void
Clear ( ) : void

清除所有缓存

ClearAllCache ( ) : void

Clears all cache.

ClearCache ( string key ) : bool
ContainsKey ( string key ) : bool

是否包含cacheKey

DisposeRefer ( int count ) : void

真正销毁对象

GCCollect ( byte segmentIndex ) : bool

手动回收 可以释放的对象

Get ( string key ) : GameObject

获取值

GetCache ( string key ) : ReferGameObjects

获取值

OnDestroy ( ) : void
Remove ( string key ) : void
StoreCache ( GameObject gobj ) : bool

放入缓存

StoreCache ( ReferGameObjects refer ) : bool

放入缓存

Update ( ) : void

内存阈值检测和自动对象回收

Private Methods

Method Description
Add ( int hash, GameObject value, byte type ) : bool

添加原始项目

AutoGC ( byte segmentIndex ) : void

自动回收对象当前segmentindex和之前的所有片段

CanGC ( int key, bool force ) : bool

能否回收

ClearCache ( int key, bool force ) : bool

清理当前key的缓存实例

ContainsKey ( int hash ) : bool
GC ( byte segmentIndex, bool force ) : bool

回收当前片段所有可回收对象

Get ( int hash ) : GameObject
GetCache ( int key ) : ReferGameObjects

获取可用的实例

Remove ( int key ) : void

Method Details

Add() public static method

添加原始缓存
public static Add ( string key, GameObject value, byte type ) : bool
key string
value UnityEngine.GameObject
type byte
return bool

Awake() public method

public Awake ( ) : void
return void

Clear() public static method

清除所有缓存
public static Clear ( ) : void
return void

ClearAllCache() public static method

Clears all cache.
public static ClearAllCache ( ) : void
return void

ClearCache() public static method

public static ClearCache ( string key ) : bool
key string
return bool

ContainsKey() public static method

是否包含cacheKey
public static ContainsKey ( string key ) : bool
key string
return bool

DisposeRefer() public method

真正销毁对象
public DisposeRefer ( int count ) : void
count int
return void

GCCollect() public static method

手动回收 可以释放的对象
public static GCCollect ( byte segmentIndex ) : bool
segmentIndex byte
return bool

Get() public static method

获取值
public static Get ( string key ) : GameObject
key string
return UnityEngine.GameObject

GetCache() public static method

获取值
public static GetCache ( string key ) : ReferGameObjects
key string
return ReferGameObjects

OnDestroy() public method

public OnDestroy ( ) : void
return void

Remove() public static method

public static Remove ( string key ) : void
key string
return void

StoreCache() public static method

放入缓存
public static StoreCache ( GameObject gobj ) : bool
gobj UnityEngine.GameObject
return bool

StoreCache() public static method

放入缓存
public static StoreCache ( ReferGameObjects refer ) : bool
refer ReferGameObjects
return bool

Update() public method

内存阈值检测和自动对象回收
public Update ( ) : void
return void

Property Details

gcDeltaTimeConfig public_oe static_oe property

两次GC检测间隔时间
public static float gcDeltaTimeConfig
return float

threshold1 public_oe static_oe property

内存阈值
public static float threshold1
return float

threshold2 public_oe static_oe property

public static float threshold2
return float

threshold3 public_oe static_oe property

public static float threshold3
return float