#if UNITY_EDITOR namespace O3DWB { public abstract class Singleton where DataType : Singleton, new() { #region Private Static Variables /// /// The singleton instance. /// /// /// Note: This assumes that the derived class must always have a public parameterless constructor. /// This implies that the client code can create instances of the derived classes. We could /// solve this using reflection, but in order to keep things simple and clean, we will avoid /// doing that. /// private static DataType _instance = new DataType(); #endregion #region Public Static Properties public static DataType Instance { get { return _instance; } } #endregion } } #endif