Disposer.cs 368 B

1234567891011121314151617181920212223242526
  1. using ETModel;
  2. namespace ETHotfix
  3. {
  4. public abstract class Disposer : Object, IDisposable2
  5. {
  6. public bool IsFromPool { get; set; }
  7. public bool IsDisposed { get; set; }
  8. public virtual void Dispose()
  9. {
  10. if (this.IsDisposed)
  11. {
  12. return;
  13. }
  14. this.IsDisposed = true;
  15. if (this.IsFromPool)
  16. {
  17. Game.ObjectPool.Recycle(this);
  18. }
  19. }
  20. }
  21. }