UnityEditor.NetworkBehaviourInspector.OnInspectorGUI C# (CSharp) Method

OnInspectorGUI() public method

public OnInspectorGUI ( ) : void
return void
        public override void OnInspectorGUI()
        {
            if (!this.m_Initialized)
            {
                base.serializedObject.Update();
                SerializedProperty property = base.serializedObject.FindProperty("m_Script");
                if (property == null)
                {
                    return;
                }
                MonoScript objectReferenceValue = property.objectReferenceValue as MonoScript;
                this.Init(objectReferenceValue);
            }
            EditorGUI.BeginChangeCheck();
            base.serializedObject.Update();
            SerializedProperty iterator = base.serializedObject.GetIterator();
            for (bool flag = true; iterator.NextVisible(flag); flag = false)
            {
                bool flag2 = this.m_SyncVarNames.Contains(iterator.name);
                if (iterator.propertyType == SerializedPropertyType.ObjectReference)
                {
                    EditorGUILayout.PropertyField(iterator, true, new GUILayoutOption[0]);
                }
                else
                {
                    EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    EditorGUILayout.PropertyField(iterator, true, new GUILayoutOption[0]);
                    if (flag2)
                    {
                        GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(52f) };
                        GUILayout.Label("SyncVar", EditorStyles.miniLabel, options);
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
            base.serializedObject.ApplyModifiedProperties();
            EditorGUI.EndChangeCheck();
            int index = 0;
            foreach (System.Reflection.FieldInfo info in base.serializedObject.targetObject.GetType().GetFields())
            {
                if ((info.FieldType.BaseType != null) && info.FieldType.BaseType.Name.Contains("SyncList"))
                {
                    this.m_ShowSyncLists[index] = EditorGUILayout.Foldout(this.m_ShowSyncLists[index], "SyncList " + info.Name + "  [" + info.FieldType.Name + "]");
                    if (this.m_ShowSyncLists[index])
                    {
                        EditorGUI.indentLevel++;
                        IEnumerable enumerable = info.GetValue(base.serializedObject.targetObject) as IEnumerable;
                        if (enumerable != null)
                        {
                            int num3 = 0;
                            IEnumerator enumerator = enumerable.GetEnumerator();
                            while (enumerator.MoveNext())
                            {
                                if (enumerator.Current != null)
                                {
                                    EditorGUILayout.LabelField("Item:" + num3, enumerator.Current.ToString(), new GUILayoutOption[0]);
                                }
                                num3++;
                            }
                        }
                        EditorGUI.indentLevel--;
                    }
                    index++;
                }
            }
            if (this.m_HasOnSerialize)
            {
                NetworkBehaviour target = base.target as NetworkBehaviour;
                if (target != null)
                {
                    EditorGUILayout.LabelField(this.m_NetworkChannelLabel, new GUIContent(target.GetNetworkChannel().ToString()), new GUILayoutOption[0]);
                    EditorGUILayout.LabelField(this.m_NetworkSendIntervalLabel, new GUIContent(target.GetNetworkSendInterval().ToString()), new GUILayoutOption[0]);
                }
            }
        }
    }
NetworkBehaviourInspector