Welcome.cs 657 B

1234567891011121314151617181920212223
  1. // Shows either a welcome message, only once per session.
  2. #if UNITY_EDITOR
  3. using UnityEditor;
  4. using UnityEngine;
  5. namespace Mirror
  6. {
  7. static class Welcome
  8. {
  9. [InitializeOnLoadMethod]
  10. static void OnInitializeOnLoad()
  11. {
  12. // InitializeOnLoad is called on start and after each rebuild,
  13. // but we only want to show this once per editor session.
  14. if (!SessionState.GetBool("MIRROR_WELCOME", false))
  15. {
  16. SessionState.SetBool("MIRROR_WELCOME", true);
  17. Debug.Log("Mirror | mirror-networking.com | discord.gg/N9QVxbM");
  18. }
  19. }
  20. }
  21. }
  22. #endif