Exemplo n.º 1
0
        protected override void RefreshPanel()
        {
            base.RefreshPanel();

            //Hide if too far
            Selectable      select = Selectable.GetByUID(inventory_uid);
            PlayerCharacter player = GetPlayer();

            if (IsVisible() && player != null && select != null)
            {
                float dist = (select.transform.position - player.transform.position).magnitude;
                if (dist > select.use_range * 1.2f)
                {
                    Hide();
                }
            }
        }