Load the scene this object is referencing playing a transition effect.

This function is designed for you to be able to call it from Unity Events in the inspector, like the On Click call from UI Buttons. You can also call it from code.

Declaration

public void TransitionToScene();

public void TransitionToScene(SceneTransitionEffect transitionEffect);

Parameters

transitionEffect The scene transition effect to play. If not provided it will search for one in the scene.

using UnityEngine;
using UnityEngine.SceneManagement;

public class TransitionToSceneOnStart : MonoBehaviour
{
		public SceneReference targetScene;
		public SceneTransitionEffect transitionEffect;

		void Start()
		{
				targetScene.TransitionToScene(transitionEffect);
		}
}