Exemple #1
0
    /// <summary>
    /// Used to show predefined hint canvases
    /// </summary>
    public void FadeIn(Script_Hint hint, Action cb = null)
    {
        hintCanvasGroup.Initialize();
        hint.gameObject.SetActive(true);

        hintCanvasGroup.gameObject.SetActive(true);

        float fadeTime = Script_Utils.GetFadeTime(hint.fadeSpeed);

        StartCoroutine(hintCanvasGroup.FadeInCo(fadeTime, cb));
    }
Exemple #2
0
    public void FadeOut(Script_Hint hint, Action cb = null)
    {
        float fadeTime = Script_Utils.GetFadeTime(hint.fadeSpeed);

        StartCoroutine(hintCanvasGroup.FadeOutCo(fadeTime, OnFadedOut));

        void OnFadedOut()
        {
            hint.gameObject.SetActive(false);

            hintCanvasGroup.gameObject.SetActive(false);
            hintCanvasGroup.Initialize();

            if (cb != null)
            {
                cb();
            }
        }
    }