Global Game Jam 2023
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.2 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using NaughtyAttributes;
  5. /// <summary>
  6. ///
  7. /// </summary>
  8. public class DontDestroyOnLoad : MonoBehaviour
  9. {
  10. #region Inspector Fields
  11. #endregion Inspector Fields
  12. #region Private Fields
  13. #endregion Private Fields
  14. #region Getters
  15. #endregion Getters
  16. #region MonoBehaviour Functions
  17. /// <summary>
  18. /// OnEnable is called when the object becomes enabled and active.
  19. /// </summary>
  20. private void OnEnable()
  21. {
  22. DontDestroyOnLoad(transform.root.gameObject);
  23. }
  24. /// <summary>
  25. /// OnDisable is called when the behaviour becomes disabled.
  26. /// </summary>
  27. private void OnDisable()
  28. {
  29. }
  30. /// <summary>
  31. /// Update is called once per frame
  32. /// </summary>
  33. private void Update()
  34. {
  35. }
  36. #endregion MonoBehaviour Functions
  37. #region Class Functionality
  38. #endregion Class Functionality
  39. #region Editor Functions
  40. /// <summary>
  41. /// Called when the Component is created or Reset from the Inspector
  42. /// </summary>
  43. private void Reset()
  44. {
  45. //useful for finding components on creation
  46. }
  47. #endregion Editor Functions
  48. }