mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Welcome message moved out of NetworkManager into standalone Editor script, per-session instead of per-play. (#3306)
This commit is contained in:
parent
0ae531b8e5
commit
b58084583f
@ -191,8 +191,6 @@ public virtual void Awake()
|
||||
// Don't allow collision-destroyed second instance to continue.
|
||||
if (!InitializeSingleton()) return;
|
||||
|
||||
Debug.Log("Mirror | mirror-networking.com | discord.gg/N9QVxbM");
|
||||
|
||||
// Apply configuration in Awake once already
|
||||
ApplyConfiguration();
|
||||
|
||||
|
23
Assets/Mirror/Editor/Welcome.cs
Normal file
23
Assets/Mirror/Editor/Welcome.cs
Normal 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
|
11
Assets/Mirror/Editor/Welcome.cs.meta
Normal file
11
Assets/Mirror/Editor/Welcome.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 180619c3887314f56bf396769c0a23ee
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user