unity method on scene loaded
using UnityEngine;
using UnityEngine.SceneManagement;
public class ExampleCode : MonoBehaviour
{
// called zero
void Awake()
{
Debug.Log("Awake");
}
// called first
void OnEnable()
{
Debug.Log("OnEnable called");
SceneManager.sceneLoaded += OnSceneLoaded;
}
// called second
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
Debug.Log("OnSceneLoaded: " + scene.name);
Debug.Log(mode);
}
// called third
void Start()
{
Debug.Log("Start");
}
// called when the game is terminated
void OnDisable()
{
Debug.Log("OnDisable");
SceneManager.sceneLoaded -= OnSceneLoaded;
}
}
Also in C#:
- stateteach.net
- how to check if an integer is in array c#
- convert string to datetime c#
- textblock line break
- c# dictionary add
- application.stop unity
- asp net identity add a unique fields to user
- c# math to radiant
- unity3d quaternion add 90 degrees
- decimals not stored in azure tables
- exception handling c# stack overflow
- .net core cli
- c# index in select
- verifyusertokenasync password reset token
- if get key down unity
- c# int
- how to randomly rotate rigidbody of object in unity
- c# bitmap to Image
- how to display an image url in c# picturebox
- countdownevent
- convert double to currency c#
- c# trigger destructor
- leantween id
- weakreference tryget c#