Пример #1
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);
                 }
             }
         }
     }
 }
Пример #2
0
 protected override void Awake()
 {
     base.Awake();
     _instance = this;
     rect      = GetComponent <RectTransform>();
 }