private void DrawActive(Rect rect)
        {
            if (GUI.Button(rect, GUIContent.none, EditorStyles.label))
            {
                this.gameObject.SetActive(!this.gameObject.activeSelf);
            }
            HierarchyProEditorIcons.IconPair iconEnabled = this.gameObject.activeSelf ? HierarchyProEditorIcons.CheckmarkOn : HierarchyProEditorIcons.CheckmarkOff;
            Rect check = rect.GetCenteredIconRect(iconEnabled);

            check.y  += 2;
            GUI.color = !this.gameObject.activeInHierarchy && this.gameObject.activeSelf ? Color.gray : Color.white;
            GUI.DrawTexture(check, iconEnabled);
            GUI.color = Color.white;
        }
Exemplo n.º 2
0
        private void DrawLocked(Rect rect)
        {
            bool locked = this.Group.LockedAny;

            if (GUI.Button(rect, GUIContent.none, EditorStyles.label))
            {
                this.Group.ToggleLock();
                SceneView.RepaintAll();
                EditorApplication.RepaintHierarchyWindow();
            }
            HierarchyProEditorIcons.IconPair iconLocked = locked ? HierarchyProEditorIcons.LockedOn : HierarchyProEditorIcons.LockedOff;
            Rect check = rect.GetCenteredIconRect(iconLocked);

            GUI.DrawTexture(check, iconLocked);
        }
        private void DrawLocked(Rect rect)
        {
            bool locked = this.gameObject.hideFlags.HasFlag(HideFlags.NotEditable);

            if (GUI.Button(rect, GUIContent.none, EditorStyles.label))
            {
                this.gameObject.hideFlags ^= HideFlags.NotEditable;
                SceneView.RepaintAll();
                HierarchyProEditor.RepaintInspector();
            }
            HierarchyProEditorIcons.IconPair iconLocked = locked ? HierarchyProEditorIcons.LockedOn : HierarchyProEditorIcons.LockedOff;
            Rect check = rect.GetCenteredIconRect(iconLocked);

            GUI.color = !this.gameObject.activeInHierarchy && this.gameObject.activeSelf ? Color.gray : Color.white;
            GUI.DrawTexture(check, iconLocked);
            GUI.color = Color.white;
        }