_EagleOwle_

Singleton

Jun 24th, 2021
31
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #region SINGLETON
  2. private static ScriptName _singleton;
  3. public static ScriptName Singleton
  4. {
  5. get
  6. {
  7. if (_singleton == null)
  8. {
  9. _singleton = GameObject.FindObjectOfType<ScriptName>();
  10. }
  11. return _singleton;
  12. }
  13. }
  14. #endregion
RAW Paste Data