コード例 #1
0
        public sealed override void OnInspectorGUI()
        {
            if (Utils.KeyHandler.HandleDetectKeyOnGUI(this.targets, Event.current))
            {
                return;
            }

            GUILayout.BeginVertical();

            ToolManager.OnPreTargetMembers(this.targets);

            DrawMembersGUI(this.targets);

            ToolManager.OnPostTargetMembers(this.targets);

            GUILayout.EndHorizontal();
        }
コード例 #2
0
ファイル: InspectorEditor.cs プロジェクト: Algoryx/AGXUnity
        public sealed override void OnInspectorGUI()
        {
            if (Utils.KeyHandler.HandleDetectKeyOnGUI(this.targets, Event.current))
            {
                return;
            }

            if (IsMainEditor && !typeof(ScriptableObject).IsAssignableFrom(target.GetType()))
            {
                var controlRect = EditorGUILayout.GetControlRect(false, 0.0f);
                if (m_icon == null)
                {
                    m_icon = IconManager.GetIcon("algoryx_white_shadow_icon");
                }

                if (m_icon != null)
                {
                    if (m_hideTexture == null)
                    {
#if UNITY_2019_3_OR_NEWER
                        var hideColor = Color.Lerp(InspectorGUI.BackgroundColor, Color.white, 0.03f);
#else
                        var hideColor = InspectorGUI.BackgroundColor;
#endif

                        m_hideTexture = GUI.CreateColoredTexture(1, 1, hideColor);
                    }

                    var hideRect = new Rect(controlRect.x,
#if UNITY_2019_3_OR_NEWER
                                            controlRect.y - 1.25f * EditorGUIUtility.singleLineHeight - 2,
#else
                                            controlRect.y - 1.00f * EditorGUIUtility.singleLineHeight - 1,
#endif
                                            18,
                                            EditorGUIUtility.singleLineHeight + 2);
                    UnityEngine.GUI.DrawTexture(hideRect, m_hideTexture);

                    var iconRect = new Rect(hideRect);
                    iconRect.height = 14.0f;
                    iconRect.width  = 14.0f;
#if UNITY_2019_3_OR_NEWER
                    iconRect.y += 2.5f;
#else
                    iconRect.y += 1.5f;
#endif
                    iconRect.x += 3.0f;
                    UnityEngine.GUI.DrawTexture(iconRect, m_icon);
                }

                InspectorGUI.BrandSeparator();
            }

            GUILayout.BeginVertical();

            ToolManager.OnPreTargetMembers(this.targets);

            DrawMembersGUI(this.targets, null, serializedObject);

            ToolManager.OnPostTargetMembers(this.targets);

            GUILayout.EndVertical();
        }