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));
     }
 }
示例#2
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (tooltip != null)
     {
         if (fadeInCoroutine != null)
         {
             StopCoroutine(fadeInCoroutine);
         }
         var localTooltip = tooltip;
         StartCoroutine(FadeUI.FadeTo(tooltipGroup, 0, fadeDuration, () => { Destroy(localTooltip); }));
     }
 }
示例#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;
 }
示例#4
0
        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));
 }