public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position) { if (m_closed) { TilesetId = AlternativeTextures.Id("Open"); atlas.MoveToOtherLayer(new GameActorPosition(this, position, LayerType.ObstacleInteractable), LayerType.OnGroundInteractable); } else { TilesetId = AlternativeTextures.Id("Closed"); atlas.MoveToOtherLayer(new GameActorPosition(this, position, LayerType.OnGroundInteractable), LayerType.ObstacleInteractable); } m_closed = !m_closed; }
public ISwitchableGameActor SwitchOff(GameActorPosition gameActorPosition, IAtlas atlas) { TilesetId = AlternativeTextures.Id("Open"); atlas.MoveToOtherLayer(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable), LayerType.ObstacleInteractable); m_closed = false; return(this); }