UnityEditor.GameObjectInspector.DrawInspector C# (CSharp) Method

DrawInspector() private method

private DrawInspector ( ) : bool
return bool
        internal bool DrawInspector()
        {
            base.serializedObject.Update();
            GameObject target = base.target as GameObject;
            GUIContent goIcon = null;
            PrefabType none = PrefabType.None;
            if (this.m_AllOfSamePrefabType)
            {
                none = PrefabUtility.GetPrefabType(target);
                switch (none)
                {
                    case PrefabType.None:
                        goIcon = s_Styles.goIcon;
                        break;

                    case PrefabType.Prefab:
                    case PrefabType.PrefabInstance:
                    case PrefabType.DisconnectedPrefabInstance:
                        goIcon = s_Styles.prefabIcon;
                        break;

                    case PrefabType.ModelPrefab:
                    case PrefabType.ModelPrefabInstance:
                    case PrefabType.DisconnectedModelPrefabInstance:
                        goIcon = s_Styles.modelIcon;
                        break;

                    case PrefabType.MissingPrefabInstance:
                        goIcon = s_Styles.prefabIcon;
                        break;
                }
            }
            else
            {
                goIcon = s_Styles.typelessIcon;
            }
            EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
            EditorGUI.ObjectIconDropDown(GUILayoutUtility.GetRect((float) 24f, (float) 24f, options), base.targets, true, goIcon.image as Texture2D, this.m_Icon);
            using (new EditorGUI.DisabledScope(none == PrefabType.ModelPrefab))
            {
                EditorGUILayout.BeginVertical(new GUILayoutOption[0]);
                EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(s_Styles.tagFieldWidth) };
                EditorGUILayout.BeginHorizontal(optionArray2);
                GUILayout.FlexibleSpace();
                GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
                EditorGUI.PropertyField(GUILayoutUtility.GetRect((float) EditorStyles.toggle.padding.left, EditorGUIUtility.singleLineHeight, EditorStyles.toggle, optionArray3), this.m_IsActive, GUIContent.none);
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.DelayedTextField(this.m_Name, GUIContent.none, new GUILayoutOption[0]);
                this.DoStaticToggleField(target);
                this.DoStaticFlagsDropDown(target);
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                this.DoTagsField(target);
                this.DoLayerField(target);
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(2f);
            using (new EditorGUI.DisabledScope(none == PrefabType.ModelPrefab))
            {
                this.DoPrefabButtons(none, target);
            }
            base.serializedObject.ApplyModifiedProperties();
            return true;
        }