浏览代码

Merge pull request #1382 from Unity-Technologies/volume-ux-improvements

Improved volume UI & styling
/main
GitHub 7 年前
当前提交
1c9edcfa
共有 4 个文件被更改,包括 22 次插入13 次删除
  1. 6
      ScriptableRenderPipeline/Core/CHANGELOG.md
  2. 7
      ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorStyles.cs
  3. 18
      ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorUtils.cs
  4. 4
      ScriptableRenderPipeline/Core/CoreRP/Editor/Volume/VolumeComponentEditor.cs

6
ScriptableRenderPipeline/Core/CHANGELOG.md


and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Improvements
- Improved volume UI & styling
- Moved root files into folders for easier maintenance
- Moved root files into folders for easier maintenance
## [0.1.6] - 2018-xx-yy

7
ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorStyles.cs


public static readonly GUIStyle smallTickbox;
public static readonly GUIStyle miniLabelButton;
public static readonly Texture2D paneOptionsIconDark;
public static readonly Texture2D paneOptionsIconLight;
static readonly Texture2D paneOptionsIconDark;
static readonly Texture2D paneOptionsIconLight;
public static Texture2D paneOptionsIcon { get { return EditorGUIUtility.isProSkin ? paneOptionsIconDark : paneOptionsIconLight; } }
smallTickbox = new GUIStyle("ShurikenCheckMark");
smallTickbox = new GUIStyle("ShurikenToggle");
var transparentTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
transparentTexture.SetPixel(0, 0, Color.clear);

18
ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorUtils.cs


var backgroundRect = GUILayoutUtility.GetRect(1f, 17f);
var labelRect = backgroundRect;
labelRect.xMin += 16f;
labelRect.xMin += 32f;
var foldoutRect = backgroundRect;
foldoutRect.y += 1f;
foldoutRect.width = 13f;
foldoutRect.height = 13f;
toggleRect.x += 16f;
toggleRect.y += 2f;
toggleRect.width = 13f;
toggleRect.height = 13f;

using (new EditorGUI.DisabledScope(!activeField.boolValue))
EditorGUI.LabelField(labelRect, GetContent(title), EditorStyles.boldLabel);
// Foldout
group.serializedObject.Update();
group.isExpanded = GUI.Toggle(foldoutRect, group.isExpanded, GUIContent.none, EditorStyles.foldout);
group.serializedObject.ApplyModifiedProperties();
// Active checkbox
activeField.serializedObject.Update();
activeField.boolValue = GUI.Toggle(toggleRect, activeField.boolValue, GUIContent.none, CoreEditorStyles.smallTickbox);

var menuIcon = EditorGUIUtility.isProSkin
? CoreEditorStyles.paneOptionsIconDark
: CoreEditorStyles.paneOptionsIconLight;
var menuIcon = CoreEditorStyles.paneOptionsIcon;
var menuRect = new Rect(labelRect.xMax + 4f, labelRect.y + 4f, menuIcon.width, menuIcon.height);
if (contextAction != null)

4
ScriptableRenderPipeline/Core/CoreRP/Editor/Volume/VolumeComponentEditor.cs


{
var overrideRect = GUILayoutUtility.GetRect(17f, 17f, GUILayout.ExpandWidth(false));
overrideRect.yMin += 4f;
var oldColor = GUI.color;
GUI.color = new Color(0.6f, 0.6f, 0.6f, 0.75f);
GUI.color = oldColor;
}
}
}
正在加载...
取消
保存