LuxURPEssentialsShowWelcome.cs 596 B

12345678910111213141516171819202122232425262728293031323334
  1. using UnityEditor;
  2. using UnityEngine;
  3. using System;
  4. using System.Collections;
  5. namespace LuxURPEssentials
  6. {
  7. [InitializeOnLoad]
  8. public class LuxURPEssentialsShowWelcome : MonoBehaviour
  9. {
  10. static LuxURPEssentialsShowWelcome()
  11. {
  12. // To show it at start up
  13. EditorApplication.update += Update;
  14. }
  15. static void Update()
  16. {
  17. EditorApplication.update -= Update;
  18. if( !EditorApplication.isPlayingOrWillChangePlaymode )
  19. {
  20. var hide = EditorPrefs.GetBool("LuxURPEssentialsDoNotShowWelcome");
  21. if(!hide)
  22. {
  23. LuxURPEssentialsWelcome.Init();
  24. }
  25. }
  26. }
  27. }
  28. }