public override void Dispose() { if (this.IsDisposed) { return; } base.Dispose(); #if SERVER foreach (var VARIABLE in ChildrenUnit) { VARIABLE.Dispose(); } #elif !SERVER GameObjectPool gameObjectPool = Game.Scene.GetComponent <GameObjectPool>(); foreach (var VARIABLE in ChildrenUnit) { gameObjectPool.Recycle(VARIABLE); } #endif ChildrenUnit.Clear(); }