SanAndreasUnity/Assets/Scripts/Utilities/DontDestroyOnLoad.cs

20 lines
256 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using UnityEngine;
namespace SanAndreasUnity.Utilities
{
public class DontDestroyOnLoad : MonoBehaviour
{
void Awake ()
{
if (null == this.transform.parent)
{
DontDestroyOnLoad (this.gameObject);
}
}
}
}