using UnityEngine; namespace GadGame.Singleton { /// /// Persistent version of the singleton. This will survive through scene /// loads. Perfect for system classes which require stateful, persistent data. Or audio sources /// where music plays through loading screens, etc /// /// Type of object you want to use singleton public abstract class PersistentSingleton : Singleton where T: Component { protected override void Awake() { base.Awake(); DontDestroyOnLoad(gameObject); } } }