Esempio n. 1
0
        private void SetOverlay(HudStateChange message)
        {
            RemoveOverlay();

            _currentEffect = message.effect;

            ApplyOverlay();
        }
Esempio n. 2
0
            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;
            }
Esempio n. 3
0
        private void ChangeHudIcon(HudStateChange changeMessage)
        {
            var path    = SharedSpriteComponent.TextureRoot / changeMessage.StateSprite;
            var texture = _resourceCache.GetTexture(path);

            _window.SetIcon(texture);
            _ui.SetHealthIcon(texture);

            SetOverlay(changeMessage);
        }
Esempio n. 4
0
    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();
                }
            }
        }
    }
Esempio n. 5
0
 private void ChangeHudIcon(HudStateChange changemessage)
 {
     _window.SetIcon(changemessage);
     SetOverlay(changemessage);
 }