Skip to content

Commit 7ae6166

Browse files
author
Philip Cosgrave
committed
commit of 2018.4 at 3c4c8d10fb99
1 parent 99a74df commit 7ae6166

55 files changed

Lines changed: 459 additions & 1173 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎UnityEditor.UI/UI/DropdownEditor.cs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class DropdownEditor : SelectableEditor
1818
SerializedProperty m_OnSelectionChanged;
1919
SerializedProperty m_Value;
2020
SerializedProperty m_Options;
21-
SerializedProperty m_AlphaFadeSpeed;
2221

2322
protected override void OnEnable()
2423
{
@@ -31,7 +30,6 @@ protected override void OnEnable()
3130
m_OnSelectionChanged = serializedObject.FindProperty("m_OnValueChanged");
3231
m_Value = serializedObject.FindProperty("m_Value");
3332
m_Options = serializedObject.FindProperty("m_Options");
34-
m_AlphaFadeSpeed = serializedObject.FindProperty("m_AlphaFadeSpeed");
3533
}
3634

3735
public override void OnInspectorGUI()
@@ -46,7 +44,6 @@ public override void OnInspectorGUI()
4644
EditorGUILayout.PropertyField(m_ItemText);
4745
EditorGUILayout.PropertyField(m_ItemImage);
4846
EditorGUILayout.PropertyField(m_Value);
49-
EditorGUILayout.PropertyField(m_AlphaFadeSpeed);
5047
EditorGUILayout.PropertyField(m_Options);
5148
EditorGUILayout.PropertyField(m_OnSelectionChanged);
5249
serializedObject.ApplyModifiedProperties();

‎UnityEditor.UI/UI/HorizontalOrVerticalLayoutGroupEditor.cs‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public class HorizontalOrVerticalLayoutGroupEditor : Editor
1818
SerializedProperty m_ChildAlignment;
1919
SerializedProperty m_ChildControlWidth;
2020
SerializedProperty m_ChildControlHeight;
21-
SerializedProperty m_ChildScaleWidth;
22-
SerializedProperty m_ChildScaleHeight;
2321
SerializedProperty m_ChildForceExpandWidth;
2422
SerializedProperty m_ChildForceExpandHeight;
2523

@@ -30,8 +28,6 @@ protected virtual void OnEnable()
3028
m_ChildAlignment = serializedObject.FindProperty("m_ChildAlignment");
3129
m_ChildControlWidth = serializedObject.FindProperty("m_ChildControlWidth");
3230
m_ChildControlHeight = serializedObject.FindProperty("m_ChildControlHeight");
33-
m_ChildScaleWidth = serializedObject.FindProperty("m_ChildScaleWidth");
34-
m_ChildScaleHeight = serializedObject.FindProperty("m_ChildScaleHeight");
3531
m_ChildForceExpandWidth = serializedObject.FindProperty("m_ChildForceExpandWidth");
3632
m_ChildForceExpandHeight = serializedObject.FindProperty("m_ChildForceExpandHeight");
3733
}
@@ -44,23 +40,14 @@ public override void OnInspectorGUI()
4440
EditorGUILayout.PropertyField(m_ChildAlignment, true);
4541

4642
Rect rect = EditorGUILayout.GetControlRect();
47-
rect = EditorGUI.PrefixLabel(rect, -1, EditorGUIUtility.TrTextContent("Control Child Size"));
43+
rect = EditorGUI.PrefixLabel(rect, -1, EditorGUIUtility.TrTextContent("Child Controls Size"));
4844
rect.width = Mathf.Max(50, (rect.width - 4) / 3);
4945
EditorGUIUtility.labelWidth = 50;
5046
ToggleLeft(rect, m_ChildControlWidth, EditorGUIUtility.TrTextContent("Width"));
5147
rect.x += rect.width + 2;
5248
ToggleLeft(rect, m_ChildControlHeight, EditorGUIUtility.TrTextContent("Height"));
5349
EditorGUIUtility.labelWidth = 0;
5450

55-
rect = EditorGUILayout.GetControlRect();
56-
rect = EditorGUI.PrefixLabel(rect, -1, EditorGUIUtility.TrTextContent("Use Child Scale"));
57-
rect.width = Mathf.Max(50, (rect.width - 4) / 3);
58-
EditorGUIUtility.labelWidth = 50;
59-
ToggleLeft(rect, m_ChildScaleWidth, EditorGUIUtility.TrTextContent("Width"));
60-
rect.x += rect.width + 2;
61-
ToggleLeft(rect, m_ChildScaleHeight, EditorGUIUtility.TrTextContent("Height"));
62-
EditorGUIUtility.labelWidth = 0;
63-
6451
rect = EditorGUILayout.GetControlRect();
6552
rect = EditorGUI.PrefixLabel(rect, -1, EditorGUIUtility.TrTextContent("Child Force Expand"));
6653
rect.width = Mathf.Max(50, (rect.width - 4) / 3);

‎UnityEditor.UI/UI/ImageEditor.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ protected void SpriteGUI()
139139
m_Type.enumValueIndex = (int)Image.Type.Simple;
140140
}
141141
}
142-
(serializedObject.targetObject as Image).DisableSpriteOptimizations();
143142
}
144143
}
145144

‎UnityEditor.UI/UI/LayoutPropertiesPreview.cs‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Linq;
33
using UnityEngine;
44
using UnityEngine.UI;
5-
using System.Globalization;
65

76
namespace UnityEditor.Events
87
{
@@ -95,17 +94,17 @@ public override void OnPreviewGUI(Rect r, GUIStyle background)
9594

9695
// Show properties
9796

98-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Min Width", LayoutUtility.GetLayoutProperty(rect, e => e.minWidth, 0, out source).ToString(CultureInfo.InvariantCulture.NumberFormat), source);
99-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Min Height", LayoutUtility.GetLayoutProperty(rect, e => e.minHeight, 0, out source).ToString(CultureInfo.InvariantCulture.NumberFormat), source);
100-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Preferred Width", LayoutUtility.GetLayoutProperty(rect, e => e.preferredWidth, 0, out source).ToString(CultureInfo.InvariantCulture.NumberFormat), source);
101-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Preferred Height", LayoutUtility.GetLayoutProperty(rect, e => e.preferredHeight, 0, out source).ToString(CultureInfo.InvariantCulture.NumberFormat), source);
97+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Min Width", LayoutUtility.GetLayoutProperty(rect, e => e.minWidth, 0, out source).ToString(), source);
98+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Min Height", LayoutUtility.GetLayoutProperty(rect, e => e.minHeight, 0, out source).ToString(), source);
99+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Preferred Width", LayoutUtility.GetLayoutProperty(rect, e => e.preferredWidth, 0, out source).ToString(), source);
100+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Preferred Height", LayoutUtility.GetLayoutProperty(rect, e => e.preferredHeight, 0, out source).ToString(), source);
102101

103102
float flexible = 0;
104103

105104
flexible = LayoutUtility.GetLayoutProperty(rect, e => e.flexibleWidth, 0, out source);
106-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Flexible Width", flexible > 0 ? ("enabled (" + flexible.ToString(CultureInfo.InvariantCulture.NumberFormat) + ")") : "disabled", source);
105+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Flexible Width", flexible > 0 ? ("enabled (" + flexible.ToString() + ")") : "disabled", source);
107106
flexible = LayoutUtility.GetLayoutProperty(rect, e => e.flexibleHeight, 0, out source);
108-
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Flexible Height", flexible > 0 ? ("enabled (" + flexible.ToString(CultureInfo.InvariantCulture.NumberFormat) + ")") : "disabled", source);
107+
ShowProp(ref labelRect, ref valueRect, ref sourceRect, "Flexible Height", flexible > 0 ? ("enabled (" + flexible.ToString() + ")") : "disabled", source);
109108

110109
if (!rect.GetComponent<LayoutElement>())
111110
{

‎UnityEditor.UI/UI/MenuOptions.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static void PlaceUIElementRoot(GameObject element, MenuCommand menuComma
9797
if (prefabStage != null && !prefabStage.IsPartOfPrefabContents(parent))
9898
parent = prefabStage.prefabContentsRoot;
9999
}
100-
if (parent.GetComponentsInParent<Canvas>(true).Length == 0)
100+
if (parent.GetComponentInParent<Canvas>() == null)
101101
{
102102
// Create canvas under context GameObject,
103103
// and make that be the parent which UI element is added under.

‎UnityEditor.UI/UI/PropertyDrawers/AnimationTriggersDrawer.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
1717
SerializedProperty normalTrigger = prop.FindPropertyRelative("m_NormalTrigger");
1818
SerializedProperty higlightedTrigger = prop.FindPropertyRelative("m_HighlightedTrigger");
1919
SerializedProperty pressedTrigger = prop.FindPropertyRelative("m_PressedTrigger");
20-
SerializedProperty selectedTrigger = prop.FindPropertyRelative("m_SelectedTrigger");
2120
SerializedProperty disabledTrigger = prop.FindPropertyRelative("m_DisabledTrigger");
2221

2322
EditorGUI.PropertyField(drawRect, normalTrigger);
@@ -26,14 +25,12 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
2625
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
2726
EditorGUI.PropertyField(drawRect, pressedTrigger);
2827
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
29-
EditorGUI.PropertyField(drawRect, selectedTrigger);
30-
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
3128
EditorGUI.PropertyField(drawRect, disabledTrigger);
3229
}
3330

3431
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
3532
{
36-
return 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
33+
return 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
3734
}
3835
}
3936
}

‎UnityEditor.UI/UI/PropertyDrawers/ColorBlockDrawer.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
1717
SerializedProperty normalColor = prop.FindPropertyRelative("m_NormalColor");
1818
SerializedProperty highlighted = prop.FindPropertyRelative("m_HighlightedColor");
1919
SerializedProperty pressedColor = prop.FindPropertyRelative("m_PressedColor");
20-
SerializedProperty selectedColor = prop.FindPropertyRelative("m_SelectedColor");
2120
SerializedProperty disabledColor = prop.FindPropertyRelative("m_DisabledColor");
2221
SerializedProperty colorMultiplier = prop.FindPropertyRelative("m_ColorMultiplier");
2322
SerializedProperty fadeDuration = prop.FindPropertyRelative("m_FadeDuration");
@@ -28,8 +27,6 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
2827
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
2928
EditorGUI.PropertyField(drawRect, pressedColor);
3029
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
31-
EditorGUI.PropertyField(drawRect, selectedColor);
32-
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
3330
EditorGUI.PropertyField(drawRect, disabledColor);
3431
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
3532
EditorGUI.PropertyField(drawRect, colorMultiplier);
@@ -39,7 +36,7 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
3936

4037
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
4138
{
42-
return 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
39+
return 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
4340
}
4441
}
4542
}

‎UnityEditor.UI/UI/PropertyDrawers/SpriteStateDrawer.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,19 @@ public override void OnGUI(Rect rect, SerializedProperty prop, GUIContent label)
1212
drawRect.height = EditorGUIUtility.singleLineHeight;
1313
SerializedProperty highlightedSprite = prop.FindPropertyRelative("m_HighlightedSprite");
1414
SerializedProperty pressedSprite = prop.FindPropertyRelative("m_PressedSprite");
15-
SerializedProperty selectedSprite = prop.FindPropertyRelative("m_SelectedSprite");
1615
SerializedProperty disabledSprite = prop.FindPropertyRelative("m_DisabledSprite");
1716

1817
EditorGUI.PropertyField(drawRect, highlightedSprite);
1918
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
2019
EditorGUI.PropertyField(drawRect, pressedSprite);
2120
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
22-
EditorGUI.PropertyField(drawRect, selectedSprite);
23-
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
2421
EditorGUI.PropertyField(drawRect, disabledSprite);
2522
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
2623
}
2724

2825
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
2926
{
30-
return 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
27+
return 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
3128
}
3229
}
3330
}

‎UnityEditor.UI/UI/RawImageEditor.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public override void OnInspectorGUI()
3838
serializedObject.Update();
3939

4040
EditorGUILayout.PropertyField(m_Texture);
41-
4241
AppearanceControlsGUI();
4342
RaycastControlsGUI();
4443
EditorGUILayout.PropertyField(m_UVRect, m_UVRectContent);

‎UnityEditor.UI/UI/SelectableEditor.cs‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ protected virtual void OnDisable()
8585

8686
private void RegisterStaticOnSceneGUI()
8787
{
88-
SceneView.duringSceneGui -= StaticOnSceneGUI;
88+
SceneView.onSceneGUIDelegate -= StaticOnSceneGUI;
8989
if (s_Editors.Count > 0)
90-
SceneView.duringSceneGui += StaticOnSceneGUI;
90+
SceneView.onSceneGUIDelegate += StaticOnSceneGUI;
9191
}
9292

9393
static Selectable.Transition GetTransition(SerializedProperty transition)
@@ -222,15 +222,13 @@ private static Animations.AnimatorController GenerateSelectableAnimatorContoller
222222
var normalName = string.IsNullOrEmpty(animationTriggers.normalTrigger) ? "Normal" : animationTriggers.normalTrigger;
223223
var highlightedName = string.IsNullOrEmpty(animationTriggers.highlightedTrigger) ? "Highlighted" : animationTriggers.highlightedTrigger;
224224
var pressedName = string.IsNullOrEmpty(animationTriggers.pressedTrigger) ? "Pressed" : animationTriggers.pressedTrigger;
225-
var selectedName = string.IsNullOrEmpty(animationTriggers.selectedTrigger) ? "Selected" : animationTriggers.selectedTrigger;
226225
var disabledName = string.IsNullOrEmpty(animationTriggers.disabledTrigger) ? "Disabled" : animationTriggers.disabledTrigger;
227226

228227
// Create controller and hook up transitions.
229228
var controller = Animations.AnimatorController.CreateAnimatorControllerAtPath(path);
230229
GenerateTriggerableTransition(normalName, controller);
231230
GenerateTriggerableTransition(highlightedName, controller);
232231
GenerateTriggerableTransition(pressedName, controller);
233-
GenerateTriggerableTransition(selectedName, controller);
234232
GenerateTriggerableTransition(disabledName, controller);
235233

236234
AssetDatabase.ImportAsset(path);
@@ -317,13 +315,11 @@ private static void StaticOnSceneGUI(SceneView view)
317315
if (!s_ShowNavigation)
318316
return;
319317

320-
Selectable[] selectables = Selectable.allSelectablesArray;
321-
322-
for (int i = 0; i < selectables.Length; i++)
318+
for (int i = 0; i < Selectable.allSelectables.Count; i++)
323319
{
324-
Selectable s = selectables[i];
325-
if (SceneManagement.StageUtility.IsGameObjectRenderedByCamera(s.gameObject, Camera.current))
326-
DrawNavigationForSelectable(s);
320+
Selectable selectable = Selectable.allSelectables[i];
321+
if (SceneManagement.StageUtility.IsGameObjectRenderedByCamera(selectable.gameObject, Camera.current))
322+
DrawNavigationForSelectable(selectable);
327323
}
328324
}
329325

0 commit comments

Comments
 (0)