You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/MMTools/Tools/MMActivation/MMDontDestroyOnLoad.cs

18 lines
401 B
C#

using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// Add this component to an object and it'll persist across scenes
/// </summary>
public class MMDontDestroyOnLoad : MonoBehaviour
{
/// <summary>
/// On Awake we make sure our object will not destroy on the next scene load
/// </summary>
protected void Awake()
{
DontDestroyOnLoad(this.gameObject);
}
}
}