Advertisement
_EagleOwle_

Singleton

Jun 24th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement