public static void Assert(bool condition) { if (!condition) { MiniCompat.LogError("Internal assertion failed."); } }
public override void Ref() { if (!_poolable) { return; } if (_refCount == 0) { MiniCompat.LogError("Reffed out of the pool!"); } _refCount++; }
public T GetInstance() { if (_pool.Count == 0) { return(null); } //Console.WriteLine("from pool"); T val = _pool.Pop(); if (val._refCount != 0) { MiniCompat.LogError("Error, pulled value with too high a ref, " + val._refCount + " type " + val.GetType().ToString()); } return(val); }
public override void Unref() { if (!_poolable) { return; } _refCount--; if (_refCount > 0) { return; } else if (_refCount < 0) { MiniCompat.LogError("Extra unref! For " + GetType().ToString()); return; } ResetState(); ReturnToPool(); //Console.WriteLine("into pool " + GetType().ToString()); }