Use nameof(OnDiscoveredServer)

This commit is contained in:
MrGadget 2024-10-25 05:04:15 -04:00
parent e6509cec34
commit 7fc7305212
2 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,7 @@ void Reset()
// Add default event handler if not already present // Add default event handler if not already present
if (!Enumerable.Range(0, networkDiscovery.OnServerFound.GetPersistentEventCount()) if (!Enumerable.Range(0, networkDiscovery.OnServerFound.GetPersistentEventCount())
.Any(i => networkDiscovery.OnServerFound.GetPersistentMethodName(i) == "OnDiscoveredServer")) .Any(i => networkDiscovery.OnServerFound.GetPersistentMethodName(i) == nameof(OnDiscoveredServer)))
{ {
UnityEditor.Events.UnityEventTools.AddPersistentListener(networkDiscovery.OnServerFound, OnDiscoveredServer); UnityEditor.Events.UnityEventTools.AddPersistentListener(networkDiscovery.OnServerFound, OnDiscoveredServer);
UnityEditor.Undo.RecordObjects(new UnityEngine.Object[] { this, networkDiscovery }, "Set NetworkDiscovery"); UnityEditor.Undo.RecordObjects(new UnityEngine.Object[] { this, networkDiscovery }, "Set NetworkDiscovery");

View File

@ -98,6 +98,7 @@ LightmapSettings:
m_TrainingDataDestination: TrainingData m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4 m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0} m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4 --- !u!196 &4
NavMeshSettings: NavMeshSettings:
serializedVersion: 2 serializedVersion: 2