mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Simplify editor a bit
This commit is contained in:
parent
d9afbfe4c9
commit
6cbef06e00
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user