private void SetOverlay(HudStateChange message) { RemoveOverlay(); _currentEffect = message.effect; ApplyOverlay(); }
public void SetIcon(HudStateChange changemessage) { if (!IoCManager.Resolve <IResourceCache>().TryGetResource <TextureResource>(new ResourcePath("/Textures") / changemessage.StateSprite, out var newtexture)) { Logger.Info("The Species Health Sprite {0} Does Not Exist", new ResourcePath("/Textures") / changemessage.StateSprite); return; } _textureRect.Texture = newtexture; }
private void ChangeHudIcon(HudStateChange changeMessage) { var path = SharedSpriteComponent.TextureRoot / changeMessage.StateSprite; var texture = _resourceCache.GetTexture(path); _window.SetIcon(texture); _ui.SetHealthIcon(texture); SetOverlay(changeMessage); }
void Update() { if (HudState == HudStates.Playing || HudState == HudStates.Menu) { if (Input.GetKeyDown(KeyCode.Tab)) { HudState = HudStates.Menu; if (HudStateChange != null) { HudStateChange.Invoke(HudState); } } else if (Input.GetKeyUp(KeyCode.Tab)) { HudState = HudStates.Playing; if (HudStateChange != null) { HudStateChange.Invoke(HudState); } } } if (HudState == HudStates.Menu) { if (Input.GetMouseButtonDown(0)) { if (ClickDown != null) { ClickDown.Invoke(); } } else if (Input.GetMouseButtonUp(0)) { if (ClickUp != null) { ClickUp.Invoke(); } } } }
private void ChangeHudIcon(HudStateChange changemessage) { _window.SetIcon(changemessage); SetOverlay(changemessage); }