public void ToggleDropDown(bool isOn)
 {
     if (lastCoroutine != null)
     {
         StopCoroutine(lastCoroutine);
     }
     //if (gameObject.activeSelf)
     if (!isOn)
     {
         //gameObject.SetActive(false);
         //reset the old parent and position so it always appears in the same location
         lastCoroutine = StartCoroutine(FadeUI.FadeTo(canvasGroup, 0, fadeSpeed /*, () =>
                                                                                 * {
                                                                                 * transform.SetParent(parent);
                                                                                 * transform.localPosition = localPosition;
                                                                                 * }*/));
     }
     else
     {
         UpdateNames();
         gameObject.SetActive(true);
         /*transform.SetParent(activeParent);*/
         lastCoroutine = StartCoroutine(FadeUI.FadeTo(canvasGroup, 1, fadeSpeed));
     }
 }
 public void OnPointerExit(PointerEventData eventData)
 {
     if (tooltip != null)
     {
         if (fadeInCoroutine != null)
         {
             StopCoroutine(fadeInCoroutine);
         }
         var localTooltip = tooltip;
         StartCoroutine(FadeUI.FadeTo(tooltipGroup, 0, fadeDuration, () => { Destroy(localTooltip); }));
     }
 }
Beispiel #3
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (eventData != null)
     {
         onElement = false;
     }
     if (tooltip != null)
     {
         if (fadeInCoroutine != null)
         {
             StopCoroutine(fadeInCoroutine);
         }
         var localTooltip = tooltip;
         StartCoroutine(FadeUI.FadeTo(tooltipGroup, 0, fadeDuration, () => { Destroy(localTooltip); }));
         tooltip = null;
     }
     //textComponent = null;
 }
        public void OnPointerEnter(PointerEventData eventData)
        {
            if (this.text.IsNullOrWhiteSpace())
            {
                return;
            }
            if (canvasTransform == null)
            {
                GetCanvas();
            }
            tooltip = Instantiate(prefab);
            tooltip.transform.SetParent(canvasTransform, false);
            tooltipGroup = tooltip.GetComponent <CanvasGroup>();
            var controller = tooltip.GetComponent <TooltipController>();

            var text = controller.textComponent;

            text.text       = this.text;
            fadeInCoroutine = StartCoroutine(FadeUI.FadeTo(tooltipGroup, 1, fadeDuration));
        }
 private void StartCloseAnimation()
 {
     StartCoroutine(FadeUI.FadeTo(canvasGroup, 0, fadeSpeed, DestroyGameObject));
 }
 private void OnEnable()
 {
     StartCoroutine(FadeUI.FadeTo(canvasGroup, 1, fadeSpeed));
 }