Example #1
0
    // Effect Based Implementations
    protected virtual void Fade(Transition transition, Effect[] effects)
    {
        float startAlpha = (transition == Transition.SHOW) ? 0F : 1F;
        float endAlpha   = (transition == Transition.SHOW) ? 1F : 0F;

        if (transitionRoutine != null)
        {
            StopCoroutine(transitionRoutine);
        }
        transitionRoutine = StartCoroutine(MenuTransitionsCommon.FadeCoroutine(startAlpha, endAlpha, faderDuration,
                                                                               canvasGroup, () =>
        {
            if (transition == Transition.SHOW)
            {
                ShowComplete();
            }
            else
            {
                HideComplete();
            }

            OnTransitionEnded(transition, effects);
        }));
    }
Example #2
0
 private void ShowHUD(object[] parameters)
 {
     StartCoroutine(MenuTransitionsCommon.FadeCoroutine(0.0f, 1.0f, 2.0f, hudCG, null));
 }
Example #3
0
 public void DoFade(float startAlpha, float endAlpha, float duration,
                    MenuTransitionsCommon.TransitionComplete callback)
 {
     StartCoroutine(MenuTransitionsCommon.FadeCoroutine(startAlpha, endAlpha, duration,
                                                        canvasGroup, callback));
 }