GameManager.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using UnityEngine;
  2. using System.Collections;
  3. class GameManager:MonoBehaviour {
  4. // Properties
  5. private GameLooper _looper;
  6. private SceneManager _sceneManager;
  7. private static GameManager instance;
  8. // ================================================================================================================
  9. // EXTENDED INTERFACE ---------------------------------------------------------------------------------------------
  10. void Awake() {
  11. DontDestroyOnLoad(gameObject);
  12. instance = this;
  13. _looper = new GameLooper();
  14. _sceneManager = new SceneManager();
  15. }
  16. void Start() {
  17. }
  18. void Update() {
  19. }
  20. // ================================================================================================================
  21. // PUBLIC INTERFACE -----------------------------------------------------------------------------------------------
  22. public GameManager getInstance() {
  23. return instance;
  24. }
  25. // ================================================================================================================
  26. // ACCESSOR INTERFACE ---------------------------------------------------------------------------------------------
  27. public GameLooper looper {
  28. get {
  29. return _looper;
  30. }
  31. }
  32. public SceneManager sceneManager {
  33. get {
  34. return _sceneManager;
  35. }
  36. }
  37. // ================================================================================================================
  38. // EXTENDABLE INTERFACE -------------------------------------------------------------------------------------------
  39. // ================================================================================================================
  40. // INTERNAL INTERFACE ---------------------------------------------------------------------------------------------
  41. }