I have New Game text/button in my Canvas/Scene and I want when I click New Game to fade out! READ MORE!

So I want when I click on New Game to slowly fade out. Now also I have a background music playing. I’d like to fade out the music with the screen. And then when the screen faded out I need to switch to my scene that only has black plane and that plane is there to create different images appear. For example my “studio” name BlackPanther. So I want BlackPanther to appear and then disappear slowly and then word “Presents” to appear slowly and disappear slowly and some other texts/logos/images. And then my “firstscene” starts. I made animation, so That will work. But in general I need fade out; and maybe if someone is kind to help - I’d give you credits in my game.

Attach this script to any GameObject, drag the button or any other canvas element to the CanvasRenderer field. Call StartCanvasFadeOut() on a button click to fade out only 1 element and StartCanvasFamilyFadeOut() to fade out whole family of Canvas Renderers
using System.Collections;
using UnityEngine;

public class FadeOutEffect : MonoBehaviour
{
    [SerializeField]
    private CanvasRenderer canvasRenderer;
    [SerializeField]
    float fadeTime = 1;
    [SerializeField]
    bool fadeOnStart;

    void Start()
    {
        if (fadeOnStart)
        {
            StartCanvasFamilyFadeOut();
        }
    }

    public void StartCanvasFadeOut()
    {
        if (canvasRenderer != null)
        {
            StartCoroutine(CanvasFadeOut(canvasRenderer));
        }
    }

    public void StartCanvasFamilyFadeOut()
    {
        if (canvasRenderer != null)
        {
            StartCoroutine(CanvasFamilyFadeOut(canvasRenderer));
        }
    }

    IEnumerator CanvasFadeOut(CanvasRenderer targetCanvas)
    {
        float currentTime = fadeTime;
        while (currentTime > 0)
        {
            targetCanvas.SetAlpha(currentTime / fadeTime);
            currentTime -= Time.deltaTime;
            yield return null;
        }
    }

    IEnumerator CanvasFamilyFadeOut(CanvasRenderer parentCanvas)
    {
        float currentTime = fadeTime;
        CanvasRenderer[] canvasRenderers = parentCanvas.GetComponentsInChildren<CanvasRenderer>();
        while (currentTime > 0)
        {
            foreach (CanvasRenderer canvasRenderer in canvasRenderers)
            {
                canvasRenderer.SetAlpha(currentTime / fadeTime);
            }
            currentTime -= Time.deltaTime;
            yield return null;
        }
    }
}