From 6cbef06e004582e7b5d2cc5d4f06ff8a564389f7 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Wed, 30 Oct 2019 05:49:04 -0700 Subject: [PATCH] Simplify editor a bit --- Assets/Mirror/Editor/NetworkIdentityEditor.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Assets/Mirror/Editor/NetworkIdentityEditor.cs b/Assets/Mirror/Editor/NetworkIdentityEditor.cs index f62f0f97c..8df4b25f8 100644 --- a/Assets/Mirror/Editor/NetworkIdentityEditor.cs +++ b/Assets/Mirror/Editor/NetworkIdentityEditor.cs @@ -16,29 +16,21 @@ public class NetworkIdentityEditor : Editor readonly GUIContent spawnLabel = new GUIContent("Spawn Object", "This causes an unspawned server object to be spawned on clients"); NetworkIdentity networkIdentity; - bool initialized; bool showObservers; void Init() { - if (initialized) + if (serverOnlyProperty == null) { - return; - } - initialized = true; - networkIdentity = target as NetworkIdentity; + networkIdentity = target as NetworkIdentity; - serverOnlyProperty = serializedObject.FindProperty("serverOnly"); - localPlayerAuthorityProperty = serializedObject.FindProperty("localPlayerAuthority"); + serverOnlyProperty = serializedObject.FindProperty("serverOnly"); + localPlayerAuthorityProperty = serializedObject.FindProperty("localPlayerAuthority"); + } } public override void OnInspectorGUI() { - if (serverOnlyProperty == null) - { - initialized = false; - } - Init(); serializedObject.Update();