Exemplo n.º 1
0
        void RefreshTooltip()
        {
            if (target != null)
            {
                rect.anchoredPosition = TheUI.Get().ScreenPointToCanvasPos(Input.mousePosition);
                //transform.position = PlayerControlsMouse.Get().GetPointingPos();
                //transform.rotation = Quaternion.LookRotation(TheCamera.Get().transform.forward, Vector3.up);

                PlayerControlsMouse mouse = PlayerControlsMouse.Get();
                if (!target.IsHovered() || mouse.IsMovingMouse())
                {
                    Hide();
                }
            }
        }
Exemplo n.º 2
0
 void Update()
 {
     if (TooltipUI.Get() != null)
     {
         PlayerControlsMouse mouse = PlayerControlsMouse.Get();
         if (select.IsHovered() && !mouse.IsMovingMouse(0.25f) && TooltipUI.Get().GetTarget() != this)
         {
             if (type == TooltipTargetType.Custom)
             {
                 TooltipUI.Get().Set(select, title, text, icon);
             }
             else
             {
                 if (construct != null)
                 {
                     TooltipUI.Get().Set(select, construct.data);
                 }
                 else if (plant != null)
                 {
                     TooltipUI.Get().Set(select, plant.data);
                 }
                 else if (item != null)
                 {
                     TooltipUI.Get().Set(select, item.data);
                 }
                 else if (character != null)
                 {
                     TooltipUI.Get().Set(select, character.data);
                 }
                 else
                 {
                     TooltipUI.Get().Set(select, title, text, icon);
                 }
             }
         }
     }
 }