public void ClearOverlay() { if (_overlayManager.HasOverlay <ExplosionDebugOverlay>()) { _overlayManager.RemoveOverlay <ExplosionDebugOverlay>(); } _debugOverlay = null; }
public override void HandleMessage(ComponentMessage message, IComponent component) { base.HandleMessage(message, component); switch (message) { case PlayerAttachedMsg _: if (!_overlayManager.HasOverlay(nameof(GasTileOverlay))) { _overlayManager.AddOverlay(new GasTileOverlay()); } break; case PlayerDetachedMsg _: if (!_overlayManager.HasOverlay(nameof(GasTileOverlay))) { _overlayManager.RemoveOverlay(nameof(GasTileOverlay)); } break; } }
private void ApplyOverlay() { if (CurrentlyControlled && _currentEffect != ScreenEffects.None) { var overlay = _effectsDictionary[_currentEffect]; if (_overlayManager.HasOverlay(overlay.ID)) { return; } _overlayManager.AddOverlay(overlay); Logger.InfoS("overlay", $"Changed overlay to {overlay}"); } }