Welcome message moved out of NetworkManager into standalone Editor script, per-session instead of per-play. (#3306)

This commit is contained in:
mischa 2022-12-13 13:16:59 +01:00 committed by GitHub
parent 0ae531b8e5
commit b58084583f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View File

@ -191,8 +191,6 @@ public virtual void Awake()
// Don't allow collision-destroyed second instance to continue. // Don't allow collision-destroyed second instance to continue.
if (!InitializeSingleton()) return; if (!InitializeSingleton()) return;
Debug.Log("Mirror | mirror-networking.com | discord.gg/N9QVxbM");
// Apply configuration in Awake once already // Apply configuration in Awake once already
ApplyConfiguration(); ApplyConfiguration();

View File

@ -0,0 +1,23 @@
// Shows either a welcome message, only once per session.
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace Mirror
{
static class Welcome
{
[InitializeOnLoadMethod]
static void OnInitializeOnLoad()
{
// InitializeOnLoad is called on start and after each rebuild,
// but we only want to show this once per editor session.
if (!SessionState.GetBool("MIRROR_WELCOME", false))
{
SessionState.SetBool("MIRROR_WELCOME", true);
Debug.Log("Mirror | mirror-networking.com | discord.gg/N9QVxbM");
}
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 180619c3887314f56bf396769c0a23ee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: