public void PlacePlayerOnlyAttribute(PlayerOnlyType playerOnlyType) { PlayerOnly playerOnly = (PlayerOnly)InstantiateTileAttributeGO <PlayerOnly>(); Tile.SetWalkable(true); Tile.AddAttribute(playerOnly); }
public void RemovePlayerOnlyAttribute(PlayerOnly playerOnlyAttribute = null) { if (playerOnlyAttribute == null) { playerOnlyAttribute = (PlayerOnly)_tile.GetAttributes().FirstOrDefault(attribute => attribute is PlayerOnly); } if (playerOnlyAttribute == null) { return; } _tile.RemoveAttribute(playerOnlyAttribute); playerOnlyAttribute.Remove(); }