public void AddCache(string key, AudioClip clip) { if (!base.Contains(key)) { base.Add(key, new SoundRefCounter(clip)); } IRefCounter counter = base.Get(key); counter.Retain(); }
public void AddCache(string key, Texture2D texture2d) { if (!base.Contains(key)) { base.Add(key, new TextureRefCounter(texture2d)); } IRefCounter counter = base.Get(key); counter.Retain(); //CDebug.LogError("TextureCache Retain key " + key + " ref " + counter.refCount); }
public void AddCache(string key, Sprite sprite) { if (!base.Contains(key)) { base.Add(key, new SpriteRefCounter(sprite)); } IRefCounter counter = base.Get(key); counter.Retain(); //CDebug.LogError("SpriteCache Retain key " + key + " ref " + counter.refCount); }
public void AddCache(string key, AssetBundle bundle) { if (!base.Contains(key)) { base.Add(key, new ABRefCounter(bundle)); } IRefCounter counter = base.Get(key); counter.Retain(); //CDebug.LogError("tex " + key + " add ref " + base.Get(key).refCnt); }
/// Retains the entity. An owner can only retain the same entity once. /// Retain/Release is part of AERC (Automatic Entity Reference Counting) /// and is used internally to prevent pooling retained entities. /// If you use retain manually you also have to /// release it manually at some point. public void Retain(object owner = null) { mAERC.Retain(owner); mToStringCache = null; }