File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
com.unity.multiplayer.mlapi/Editor Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -174,9 +174,12 @@ public override void OnInspectorGUI()
174
174
EditorGUI . BeginChangeCheck ( ) ;
175
175
serializedObject . Update ( ) ;
176
176
177
- for ( int i = 0 ; i < m_NetworkVariableNames . Count ; i ++ )
177
+ if ( EditorApplication . isPlaying )
178
178
{
179
- RenderNetworkVariable ( i ) ;
179
+ for ( int i = 0 ; i < m_NetworkVariableNames . Count ; i ++ )
180
+ {
181
+ RenderNetworkVariable ( i ) ;
182
+ }
180
183
}
181
184
182
185
var property = serializedObject . GetIterator ( ) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public override void OnInspectorGUI()
27
27
{
28
28
Initialize ( ) ;
29
29
30
- if ( ! m_NetworkObject . IsSpawned && m_NetworkObject . NetworkManager != null && m_NetworkObject . NetworkManager . IsServer )
30
+ if ( EditorApplication . isPlaying && ! m_NetworkObject . IsSpawned && m_NetworkObject . NetworkManager != null && m_NetworkObject . NetworkManager . IsServer )
31
31
{
32
32
EditorGUILayout . BeginHorizontal ( ) ;
33
33
EditorGUILayout . LabelField ( new GUIContent ( "Spawn" , "Spawns the object across the network" ) ) ;
@@ -39,7 +39,7 @@ public override void OnInspectorGUI()
39
39
40
40
EditorGUILayout . EndHorizontal ( ) ;
41
41
}
42
- else if ( m_NetworkObject . IsSpawned )
42
+ else if ( EditorApplication . isPlaying && m_NetworkObject . IsSpawned )
43
43
{
44
44
var guiEnabled = GUI . enabled ;
45
45
GUI . enabled = false ;
You can’t perform that action at this time.
0 commit comments