void Awake() { if (instance == null) { instance = this; } }
public static LuaTimerManager initForGameObject(GameObject dontDestroyOnLoadGameObject) { if (instance == null) { instance = dontDestroyOnLoadGameObject.AddComponent <LuaTimerManager>(); } return(instance); }
public static LuaTimerManager getInstance() { if (instance == null) { GameObject gameObject = new GameObject("LuaTimerManager"); DontDestroyOnLoad(gameObject); instance = gameObject.AddComponent <LuaTimerManager>(); } return(instance); }