/// <summary>
 /// To be called using the Invoke function
 /// </summary>
 private void FadeOutWithTime()
 {
     foreach (CanvasGroup child in containers)
     {
         StartCoroutine(UIAnimation.FadeOut(child, 0.5f));
     }
 }
 /// <summary>
 /// // This method is called everytime the entity exits a collider that is set to work as a trigger
 /// </summary>
 /// <param name="other"> the trigger that caused the collision</param>
 void OnTriggerExit(Collider other)
 {
     if (other.tag == triggerTag)
     {
         // Reset the variable states
         StartCoroutine(UIAnimation.FadeOut(promptCanvasGroup, dialoguePromptFadeTime));
         Invoke("ClearAfterExit", 1f);
     }
 }
コード例 #3
0
    public void TogglePause()
    {
        isPaused = !isPaused;

        if (!isPaused)
        {
            StartCoroutine(UIAnimation.FadeOut(cv, 0.5f));
        }
        else
        {
            StartCoroutine(UIAnimation.FadeIn(cv, 0.5f));
        }

        EventSystem.current.GetComponent <EventSystem>().SetSelectedGameObject(null);
    }
コード例 #4
0
    public IEnumerator Transition(OnTransitionFinish onTransitionFinish)
    {
        float animTime = .5f;

        yield return(UIAnimation.FadeIn(GetComponent <RectTransform>(), GetComponent <CanvasGroup>(), animTime, .99f));

        yield return(new WaitForSeconds(10 * animTime));

        yield return(UIAnimation.FadeOut(GetComponent <RectTransform>(), GetComponent <CanvasGroup>(), animTime));

        onTransitionFinish();
        Canvass.sphereUIWrapper.SetActive(false);
        Canvass.sphereUIRenderer.SetActive(false);
        Canvass.sphereUIPanelWrapper.SetActive(true);
    }
コード例 #5
0
    public void FadeOutTo(CanvasGroup cv)
    {
        GetCurrentCanvasIndex();

        if (currentCanvasIndex - 1 < 0)
        {
            return;
        }

        // Fade out the current canvas group downwards
        StartCoroutine(UIAnimation.FadeOut(canvasGroups[currentCanvasIndex], 0.5f));
        iTween.MoveBy(canvasGroups[currentCanvasIndex].gameObject, iTween.Hash("y", -1, "speed", 1.1f, "easeType", "easeInOutExpo"));

        currentCanvasIndex--;

        StartCoroutine(FadeObjectIn(cv, -1, 0.2f));
    }
 void FadeOut()
 {
     StartCoroutine(UIAnimation.FadeOut(this.GetComponent <CanvasGroup>(), 1));
 }