Fading from my splash screen

Basically I have a scene with a splash screen and I want it to fade in from the unity splash screen and fade out to my game menu. I want the splash screen also to stay for 2 seconds and then fade out. I would love for the script to be javascript but it can be c#. I’ve seen questions about splash screens before but none of them work for me.

I would create a full-screen black (or white) image that starts fully opaque. Then slowly fade it to transparent, leave it that way for 2 seconds, then fade it back to being opaque.

This is basically the same technique that is used in the Survival Shooter Unity demo project for the red flash when the player gets hurt.

This is a coroutine I use to fade-to-black that illustrates the principle. fader is a reference to the full-screen black image.

	private IEnumerator FadeToBlackCoroutine() {
		float fade = 0.0f;
		do {
			Color c = fadeImage.color;
			c.a = Mathf.Lerp(0.0f, 1.0f, fade);
			fadeImage.color = c;
			fade += fadeSpeed * Time.deltaTime;
			yield return null;
		} while(fade <= 1.0f);