public override void OnRemove() { base.OnRemove(); if (this.Tile != null) { this.Tile.Entities.Remove(this.Entity); } this.Tile = null; }
public void SetTile(TiledIntegrator.Tile tile) { if (this.Tile == tile) return; if (this.Tile != null) this.Tile.Entities.Remove(this.Entity); this.Tile = tile; if( this.Tile != null ) this.Tile.Entities.Add(this.Entity); }
/// <summary> /// Changes the tile and updates the new and old tiles' entity list /// </summary> /// <param name="tile"></param> public void SetTile(TiledIntegrator.Tile tile) { if (this.Tile == tile) { return; } if (this.Tile != null) { this.Tile.Entities.Remove(this.Entity); } this.Tile = tile; if (this.Tile != null) { this.Tile.Entities.Add(this.Entity); } }