Ejemplo n.º 1
0
        // Use this for initialization
        private void Awake()
        {
            //in this line you need to change the string in order to get your Camera //TODO MAYBE DO IT FROM THE INSPECTOR
            //GUICamera = GameObject.Find("GUICamera").GetComponent<Camera>();
            //GUICamera = (Camera)GameObject.FindWithTag("MainCamera");// MainCamera.cameraMy;
            GameObject gameControllerObject = GameObject.FindWithTag("MainCamera");

            if (gameControllerObject != null)
            {
                GUICamera = gameControllerObject.GetComponent <Camera>();
            }

            GUIMode = this.transform.parent.parent.GetComponent <Canvas>().renderMode;

            bgImageSource = bgImage.GetComponent <Image>();

            //at start the pointer is never to be considered over and UI element
            inside = false;

            //assign the tooltip to the singleton GUI class manager for fast access
            //TacticalGUIManager.tgm.mmttp = this;

            //hide the tooltip
            HideTooltipVisibility();
            this.transform.parent.gameObject.SetActive(false);
            thatObjectLink = this;
        }
Ejemplo n.º 2
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (TooltipBase.get() != null)
     {
         TooltipBase.get().HideTooltip();
     }
     inside = false;
 }
Ejemplo n.º 3
0
 public void Hide()
 {
     if (TooltipBase.get() != null)
     {
         TooltipBase.get().HideTooltip();
     }
     inside = false;
 }
Ejemplo n.º 4
0
 public void Show()
 {
     if (text != "" || dynamicText != null)
     {
         if (dynamicText == null)
         {
             TooltipBase.get().SetTooltip(text);
         }
         else
         {
             TooltipBase.get().SetTooltip(dynamicText());
         }
         inside = true;
     }
 }
Ejemplo n.º 5
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (text != "" || dynamicText != null)
     {
         if (dynamicText == null)
         {
             TooltipBase.get().SetTooltip(text);
         }
         else
         {
             TooltipBase.get().SetTooltip(dynamicText());
         }
         inside = true;
     }
 }