Ejemplo n.º 1
0
        void Update()
        {
            bool updateHotEntity = !PlayerController.instance.FixedSelection();

            pickups.Clear();
            if (highlightPickups)
            {
                FindVisiblePickups();
            }
            pickupHighlighter.Show(pickups, updateHotEntity);

            if (updateHotEntity)
            {
                if (Ui.Hover)
                {
                    HotEntity = null;
                }
                else if (pickupHighlighter.Hot != null)
                {
                    HotEntity = pickupHighlighter.Hot;
                }
                else
                {
                    HotEntity = CalcHotEntity();
                }
            }

            if (HotEntity != null && !highlightPickups)
            {
                var character = HotEntity.GetComponent <Character>();
                if (character && character.monStat != null)
                {
                    if (character.monStat.interact)
                    {
                        ShowLabel(HotEntity);
                    }
                    else if (character.monStat.killable)
                    {
                        ShowEnemyBar(character);
                    }
                    else
                    {
                        ShowNothing();
                    }
                }
                else
                {
                    ShowLabel(HotEntity);
                }
            }
            else
            {
                ShowNothing();
            }
        }
Ejemplo n.º 2
0
        void Update()
        {
            bool updateHotEntity = !PlayerController.instance.FixedSelection();

            if (!highlightPickups)
            {
                pickups.Clear();
            }
            pickupHighlighter.Show(pickups, updateHotEntity);
            pickups.Clear();
            if (updateHotEntity)
            {
                if (highlightPickups && pickupHighlighter.Hot != null)
                {
                    HotEntity = pickupHighlighter.Hot;
                }
                else
                {
                    HotEntity = newHotEntity;
                }
            }
            newHotEntity = null;

            if (HotEntity != null && !highlightPickups)
            {
                var character = HotEntity.GetComponent <Character>();
                if (character && character.monStat != null)
                {
                    if (character.monStat.interact)
                    {
                        ShowLabel(HotEntity);
                    }
                    else if (character.monStat.killable)
                    {
                        ShowEnemyBar(character);
                    }
                    else
                    {
                        ShowNothing();
                    }
                }
                else
                {
                    ShowLabel(HotEntity);
                }
            }
            else
            {
                ShowNothing();
            }

            mousePos   = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            mousePos.z = 0;
        }