| 12345678910111213141516171819202122 |
- using System;
- namespace SAGA.DotNetUtils.Data
- {
- public class SingleInstance<T> where T: new()
- {
- private static T m_Instance;
- public static T Instance
- {
- get
- {
- if (SingleInstance<T>.m_Instance == null)
- {
- SingleInstance<T>.m_Instance = (default(T) == null) ? Activator.CreateInstance<T>() : default(T);
- }
- return SingleInstance<T>.m_Instance;
- }
- }
- }
- }
|