diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 00000000..1586a483 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,6 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedGame" + ] +} diff --git a/Assets/Editor Toolbox/CHANGELOG.md b/Assets/Editor Toolbox/CHANGELOG.md index f90251c6..332809d8 100644 --- a/Assets/Editor Toolbox/CHANGELOG.md +++ b/Assets/Editor Toolbox/CHANGELOG.md @@ -1,3 +1,16 @@ +## 0.9.0 [19.07.2021] + +### Added: +- FormattedNumberAttribute +- SceneAsset picker for the SceneNameAttribute +- Optional foldout for the ReorderableList and related attributes +- GuiColorAttribute + +### Changed: + +- Remove obsolete attributes +- Rename ToolboxCompositionAttribute class to ToolboxArchetypeAttribute + ## 0.8.13 [04.07.2021] ### Added: diff --git a/Assets/Editor Toolbox/Editor/Drawers/Internal.meta b/Assets/Editor Toolbox/Editor/Drawers/Internal.meta new file mode 100644 index 00000000..2e36b2b6 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/Internal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d294f5bb5d903b44dab5dd7eb495a89e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FolderDataDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs similarity index 98% rename from Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FolderDataDrawer.cs rename to Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs index 477a68f3..56eb9daa 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FolderDataDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs @@ -8,8 +8,6 @@ namespace Toolbox.Editor.Drawers [CustomPropertyDrawer(typeof(FolderData))] internal class FolderDataDrawer : PropertyDrawer { - private const string selectorEventName = "ObjectSelectorUpdated"; - private const int largeIconPickedId = 1001; private const int smallIconPickedId = 1002; @@ -81,15 +79,15 @@ public override float GetPropertyHeight(SerializedProperty property, GUIContent var pathProperty = property.FindPropertyRelative("path"); var tooltipProperty = property.FindPropertyRelative("tooltip"); - //check if type is path-based or name-based - height += typeProperty.intValue == 0 - ? EditorGUI.GetPropertyHeight(pathProperty) - : EditorGUI.GetPropertyHeight(nameProperty); height += EditorGUI.GetPropertyHeight(tooltipProperty); height += Style.height; height += Style.height; height += Style.largeFolderHeight; height += Style.spacing * 4; + //check if type is path-based or name-based + height += typeProperty.intValue == 0 + ? EditorGUI.GetPropertyHeight(pathProperty) + : EditorGUI.GetPropertyHeight(nameProperty); return height; } @@ -210,7 +208,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten } //catch object selection event and assign it to proper property - if (Event.current.commandName == selectorEventName) + if (Event.current.commandName == "ObjectSelectorUpdated") { //get proper action id by removing unique property hash code var rawPickId = EditorGUIUtility.GetObjectPickerControlID(); diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FolderDataDrawer.cs.meta b/Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs.meta similarity index 100% rename from Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FolderDataDrawer.cs.meta rename to Assets/Editor Toolbox/Editor/Drawers/Internal/FolderDataDrawer.cs.meta diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ClampAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ClampAttributeDrawer.cs index 2f85587b..6268c64b 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ClampAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ClampAttributeDrawer.cs @@ -15,17 +15,25 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU { var minValue = Attribute.MinValue; var maxValue = Attribute.MaxValue; - - if (property.propertyType == SerializedPropertyType.Float) + if (property.hasMultipleDifferentValues) { - property.floatValue = Mathf.Clamp(property.floatValue, minValue, maxValue); + EditorGUI.PropertyField(position, property, label); + return; } - else + + switch (property.propertyType) { - property.intValue = Mathf.Clamp(property.intValue, (int)minValue, (int)maxValue); + case SerializedPropertyType.Float: + property.floatValue = Mathf.Clamp(property.floatValue, minValue, maxValue); + break; + case SerializedPropertyType.Integer: + property.intValue = (int)Mathf.Clamp(property.intValue, minValue, maxValue); + break; + default: + break; } - EditorGUI.PropertyField(position, property, label, property.isExpanded); + EditorGUI.PropertyField(position, property, label); } diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/DirectoryAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/DirectoryAttributeDrawer.cs index 0600960d..2c9690e0 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/DirectoryAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/DirectoryAttributeDrawer.cs @@ -17,12 +17,48 @@ private static bool IsPathValid(string propertyPath, string assetRelativePath) return Directory.Exists(targetPath); } + private Rect DrawWarningMessage(Rect position) + { + position = new Rect(position.x, + position.y, + position.width, Style.boxHeight); + EditorGUI.HelpBox(position, "Provided directory does not exist.", MessageType.Warning); + return position; + } + + private void UseDirectoryPicker(SerializedProperty property, string relativePath) + { + var baseDataPath = Application.dataPath; + var baseOpenPath = Path.GetFileName(baseDataPath); + if (!string.IsNullOrEmpty(relativePath)) + { + baseDataPath = Path.Combine(baseDataPath, relativePath); + baseOpenPath = Path.Combine(baseOpenPath, relativePath); + } + + var selectedPath = EditorUtility.OpenFolderPanel("Pick directory", baseOpenPath, ""); + if (!string.IsNullOrEmpty(selectedPath)) + { + //Unity's API always returns slash + baseDataPath = baseDataPath.Replace('\\', '/'); + selectedPath = selectedPath.Replace(baseDataPath, ""); + selectedPath = selectedPath.Remove(0, 1); + + property.serializedObject.Update(); + property.stringValue = selectedPath; + property.serializedObject.ApplyModifiedProperties(); + } + + //NOTE: we have to exit GUI since the EditorUtility.OpenFolderPanel method will break the layouting system + GUIUtility.ExitGUI(); + } + protected override float GetPropertyHeightSafe(SerializedProperty property, GUIContent label) { //validate property type and serialized path - return IsPathValid(property.stringValue, Attribute.RelativePath) - ? base.GetPropertyHeightSafe(property, label) + return IsPathValid(property.stringValue, Attribute.RelativePath) + ? base.GetPropertyHeightSafe(property, label) : base.GetPropertyHeightSafe(property, label) + Style.boxHeight + Style.spacing * 2; } @@ -31,47 +67,20 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU //validate currently serialized path value if (!IsPathValid(property.stringValue, Attribute.RelativePath)) { - var helpBoxRect = new Rect(position.x, - position.y, - position.width, Style.boxHeight); - EditorGUI.HelpBox(helpBoxRect, "Provided directory does not exist.", MessageType.Warning); - position.y += Style.boxHeight + Style.spacing + Style.spacing; + position = DrawWarningMessage(position); + position.yMin = position.yMax + Style.spacing; + position.yMax = position.yMin + Style.rowHeight; } - position.height = Style.rowHeight; - position.width -= Style.directoryButtonWidth + Style.spacing; - //draw the default string property field + position.xMax -= Style.pickerWidth + Style.spacing; EditorGUI.PropertyField(position, property, label); - position.x = position.xMax + Style.spacing; - position.width = Style.directoryButtonWidth; + position.xMax += Style.pickerWidth + Style.spacing; + position.xMin = position.xMax - Style.pickerWidth; //create additional pick directory button - if (GUI.Button(position, Style.directoryButtonContent, EditorStyles.miniButton)) + if (GUI.Button(position, Style.pickerContent, EditorStyles.miniButton)) { - var relativePath = Attribute.RelativePath; - var baseDataPath = Application.dataPath; - var baseOpenPath = "Assets"; - if (!string.IsNullOrEmpty(relativePath)) - { - baseDataPath = Path.Combine(baseDataPath, relativePath); - baseOpenPath = Path.Combine(baseOpenPath, relativePath); - } - - var selectedPath = EditorUtility.OpenFolderPanel("Pick directory", baseOpenPath, ""); - if (!string.IsNullOrEmpty(selectedPath)) - { - //Unity's API always returns slash - baseDataPath = baseDataPath.Replace('\\', '/'); - selectedPath = selectedPath.Replace(baseDataPath, ""); - selectedPath = selectedPath.Remove(0, 1); - - property.serializedObject.Update(); - property.stringValue = selectedPath; - property.serializedObject.ApplyModifiedProperties(); - } - - //NOTE: we have to exit GUI since the EditorUtility.OpenFolderPanel method will break the layouting system - GUIUtility.ExitGUI(); + UseDirectoryPicker(property, Attribute.RelativePath); } } @@ -94,13 +103,14 @@ private static class Style internal static readonly float boxHeight = EditorGUIUtility.singleLineHeight * 2.5f; #endif internal static readonly float spacing = EditorGUIUtility.standardVerticalSpacing; - internal static readonly float directoryButtonWidth = 30.0f; + internal static readonly float pickerWidth = 30.0f; - internal static readonly GUIContent directoryButtonContent; + internal static readonly GUIContent pickerContent; static Style() { - directoryButtonContent = new GUIContent(EditorGUIUtility.FindTexture("Folder Icon"), "Pick directory"); + pickerContent = EditorGUIUtility.IconContent("Folder Icon"); + pickerContent.tooltip = "Pick directory"; } } } diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs new file mode 100644 index 00000000..40d9ae01 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs @@ -0,0 +1,80 @@ +using System; +using System.Globalization; + +using UnityEditor; +using UnityEngine; + +namespace Toolbox.Editor.Drawers +{ + [CustomPropertyDrawer(typeof(FormattedNumberAttribute))] + public class FormattedNumberAttributeDrawer : ToolboxNativePropertyDrawer + { + private readonly NumberFormatInfo formatInfo = new NumberFormatInfo() + { + NumberGroupSeparator = " ", + CurrencySymbol = "$", + CurrencyDecimalSeparator = "." + }; + + + private void ApplyControlName(string propertyKey) + { + GUI.SetNextControlName(propertyKey); + } + + private bool IsControlEditing(string propertyKey) + { + return EditorGUIUtility.editingTextField && GUI.GetNameOfFocusedControl() == propertyKey; + } + + private Single GetSingle(SerializedProperty property) + { + return property.propertyType == SerializedPropertyType.Integer + ? property.intValue + : property.floatValue; + } + + private string GetFormat(SerializedProperty property, FormattedNumberAttribute attribute) + { + var isInt = property.propertyType == SerializedPropertyType.Integer; + return string.Format("{0}{1}", attribute.Format, isInt ? 0 : attribute.DecimalsToShow); + } + + + protected override void OnGUISafe(Rect position, SerializedProperty property, GUIContent label) + { + var key = property.GetPropertyHashKey(); + ApplyControlName(key); + EditorGUI.PropertyField(position, property, label); + if (IsControlEditing(key)) + { + position.width = 0; + position.height = 0; + } + else + { + position.xMin += EditorGUIUtility.labelWidth + EditorGUIUtility.standardVerticalSpacing; + } + + var targetAttribute = attribute as FormattedNumberAttribute; + var single = GetSingle(property); + var format = GetFormat(property, targetAttribute); + + try + { + EditorGUI.TextField(position, single.ToString(format, formatInfo)); + } + catch (FormatException) + { + ToolboxEditorLog.AttributeUsageWarning(attribute, property, string.Format("{0} format is not supported.", format)); + } + } + + + public override bool IsPropertyValid(SerializedProperty property) + { + return property.propertyType == SerializedPropertyType.Integer || + property.propertyType == SerializedPropertyType.Float; + } + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs.meta b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs.meta similarity index 83% rename from Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs.meta rename to Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs.meta index 193b5690..df85779a 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs.meta +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/FormattedNumberAttributeDrawer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 965992a56fe4ca748b2294ac72e058f2 +guid: 68debf9d70bfb99489d951a43400c6c6 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LabelByChildAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LabelByChildAttributeDrawer.cs index 274d81b9..73bdaf37 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LabelByChildAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LabelByChildAttributeDrawer.cs @@ -88,12 +88,12 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU //validate availability of the child property if (childProperty != null) { - //set new label if found (unknown values will be ignored) + //set new label if found (unknown types will be ignored) label = GetLabelByValue(childProperty, label); } else { - ToolboxEditorLog.AttributeUsageWarning(attribute, property, propertyName + " does not exists."); + ToolboxEditorLog.AttributeUsageWarning(attribute, property, string.Format("{0} does not exists.", propertyName)); } EditorGUI.PropertyField(position, property, label, property.isExpanded); diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LayerAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LayerAttributeDrawer.cs index c396731a..9f2e205b 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LayerAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/LayerAttributeDrawer.cs @@ -1,5 +1,4 @@ using UnityEditor; -using UnityEditorInternal; using UnityEngine; namespace Toolbox.Editor.Drawers diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ProgressBarAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ProgressBarAttributeDrawer.cs index c5a5b4ee..70db2aab 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ProgressBarAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/ProgressBarAttributeDrawer.cs @@ -14,18 +14,21 @@ protected override float GetPropertyHeightSafe(SerializedProperty property, GUIC protected override void OnGUISafe(Rect position, SerializedProperty property, GUIContent label) { var attribute = Attribute; - //determine the real value of the property - var value = property.propertyType == SerializedPropertyType.Integer ? property.intValue : property.floatValue; + var value = property.propertyType == SerializedPropertyType.Integer + ? property.intValue + : property.floatValue; - var color = attribute.GetBarColor(); + var fillLabel = attribute.Name; + var fillColor = attribute.Color; var minValue = attribute.MinValue; var maxValue = attribute.MaxValue; //set the value text label (add name if needed) var valueText = property.hasMultipleDifferentValues ? "-" : value.ToString(); - var labelText = !string.IsNullOrEmpty(attribute.Name) - ? attribute.Name + " " + valueText + "|" + maxValue : valueText + "|" + maxValue; + var labelText = !string.IsNullOrEmpty(fillLabel) + ? string.Format("{0} {1}|{2}", fillLabel, valueText, maxValue) + : string.Format("{0}|{1}", valueText, maxValue); //clamp current value between min and max values value = Mathf.Clamp(value, minValue, maxValue); @@ -39,7 +42,7 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU //draw the background and fill colors EditorGUI.DrawRect(position, Style.backgroundColor); - EditorGUI.DrawRect(fillRect, color); + EditorGUI.DrawRect(fillRect, fillColor); //adjust rect for the shadow label var diff = Style.barHeight - Style.rowHeight; diff --git a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/SceneNameAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/SceneNameAttributeDrawer.cs index 29ab3235..cb3bfb45 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/SceneNameAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/RegularDrawers/SceneNameAttributeDrawer.cs @@ -1,5 +1,6 @@ using UnityEditor; using UnityEngine; +using UnityEngine.SceneManagement; namespace Toolbox.Editor.Drawers { @@ -13,9 +14,9 @@ private static bool SceneExists(string sceneName) return false; } - for (var i = 0; i < UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings; i++) + for (var i = 0; i < SceneManager.sceneCountInBuildSettings; i++) { - var scenePath = UnityEngine.SceneManagement.SceneUtility.GetScenePathByBuildIndex(i); + var scenePath = SceneUtility.GetScenePathByBuildIndex(i); var lastSlash = scenePath.LastIndexOf("/"); var name = scenePath.Substring(lastSlash + 1, scenePath.LastIndexOf(".") - lastSlash - 1); @@ -28,6 +29,40 @@ private static bool SceneExists(string sceneName) return false; } + private Rect DrawWarningMessage(Rect position) + { + position = new Rect(position.x, + position.y, + position.width, Style.boxHeight); + EditorGUI.HelpBox(position, "Scene does not exist. " + + "Check available Scenes in the Build options.", MessageType.Warning); + return position; + } + + private void HandleTargetPicker(Rect position, SerializedProperty property) + { + var controlId = GUIUtility.GetControlID(FocusType.Keyboard); + if (GUI.Button(position, Style.pickerButtonContent, EditorStyles.miniButton)) + { + EditorGUIUtility.ShowObjectPicker(null, false, null, controlId); + } + + if (Event.current.commandName == "ObjectSelectorUpdated") + { + if (controlId == EditorGUIUtility.GetObjectPickerControlID()) + { + var target = EditorGUIUtility.GetObjectPickerObject(); + if (target) + { + property.serializedObject.Update(); + property.stringValue = target.name; + property.serializedObject.ApplyModifiedProperties(); + GUI.changed = true; + } + } + } + } + protected override float GetPropertyHeightSafe(SerializedProperty property, GUIContent label) { @@ -40,18 +75,17 @@ protected override void OnGUISafe(Rect position, SerializedProperty property, GU { if (!SceneExists(property.stringValue)) { - //set rect for the warning message field - var helpBoxRect = new Rect(position.x, - position.y, - position.width, Style.boxHeight); - EditorGUI.HelpBox(helpBoxRect, "Scene does not exist. " + - "Check available Scenes in the Build options.", MessageType.Warning); - - //adjust rect for standard property field - position.yMin += Style.boxHeight + Style.spacing * 2; + position = DrawWarningMessage(position); + position.yMin = position.yMax + Style.spacing; + position.yMax = position.yMin + Style.rowHeight; } - EditorGUI.PropertyField(position, property, label, property.isExpanded); + position.xMax -= Style.pickerWidth + Style.spacing; + EditorGUI.PropertyField(position, property, label); + position.xMax += Style.pickerWidth + Style.spacing; + position.xMin = position.xMax - Style.pickerWidth; + + HandleTargetPicker(position, property); } @@ -70,7 +104,15 @@ private static class Style internal static readonly float boxHeight = EditorGUIUtility.singleLineHeight * 2.5f; #endif internal static readonly float spacing = EditorGUIUtility.standardVerticalSpacing; - internal static readonly float padding = 5.0f; + internal static readonly float pickerWidth = 30.0f; + + internal static readonly GUIContent pickerButtonContent; + + static Style() + { + pickerButtonContent = EditorGUIUtility.IconContent("SceneAsset Icon"); + pickerButtonContent.tooltip = "Pick Scene"; + } } } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/BeginHorizontalGroupAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/BeginHorizontalGroupAttributeDrawer.cs index 4b68a047..a64b86e3 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/BeginHorizontalGroupAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/BeginHorizontalGroupAttributeDrawer.cs @@ -24,16 +24,11 @@ private void HandleScrollView(float fixedHeight) var controlId = storage.GetControlId(); var oldScroll = storage.ReturnItem(controlId, Vector2.zero); var newScroll = fixedHeight > 0.0f - ? EditorGUILayout.BeginScrollView(oldScroll, GUILayout.Height(fixedHeight)) - : EditorGUILayout.BeginScrollView(oldScroll); + ? EditorGUILayout.BeginScrollView(oldScroll, Style.scrollViewGroupStyle, GUILayout.Height(fixedHeight)) + : EditorGUILayout.BeginScrollView(oldScroll, Style.scrollViewGroupStyle); storage.AppendItem(controlId, newScroll); } - private void ApplyIndentLevel() - { - GUILayout.Space(Style.extraIndentLevel); - } - protected override void OnGuiBeginSafe(BeginHorizontalGroupAttribute attribute) { @@ -50,18 +45,13 @@ protected override void OnGuiBeginSafe(BeginHorizontalGroupAttribute attribute) HandleScrollView(fixedHeight); ToolboxLayoutHelper.BeginHorizontal(); - ApplyIndentLevel(); } private static class Style { - /// - /// Additional indent applied to keep foldout-based labels within the group. - /// - internal static readonly float extraIndentLevel = 8.0f; - internal static readonly GUIStyle groupBackgroundStyle; + internal static readonly GUIStyle scrollViewGroupStyle; static Style() { @@ -73,6 +63,12 @@ static Style() { padding = new RectOffset(13, 12, 5, 5) }; + + //NOTE: we need to add the right padding to keep foldout-based properties fully visible + scrollViewGroupStyle = new GUIStyle("scrollView") + { + padding = new RectOffset(13, 8, 2, 2) + }; } } } diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs new file mode 100644 index 00000000..cc862888 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace Toolbox.Editor.Drawers +{ + public class GuiColorAttributeDrawer : ToolboxDecoratorDrawer + { + private Color formerGuiColor; + + + protected override void OnGuiBeginSafe(GuiColorAttribute attribute) + { + formerGuiColor = GUI.color; + GUI.color = attribute.Color; + } + + protected override void OnGuiCloseSafe(GuiColorAttribute attribute) + { + GUI.color = formerGuiColor; + } + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs.meta b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs.meta similarity index 83% rename from Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs.meta rename to Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs.meta index cbb2d708..d7d9874a 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs.meta +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/DecoratorDrawers/GuiColorAttributeDrawer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 190bce7ba8157df44aff01a1c51ae258 +guid: d9f38cd1beaa9a044b8ee7e277dafeb3 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs new file mode 100644 index 00000000..399df2e3 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs @@ -0,0 +1,9 @@ +namespace Toolbox.Editor.Drawers +{ + public enum PropertyCondition + { + Valid, + NonValid, + Disabled + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs.meta b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs.meta new file mode 100644 index 00000000..21e42160 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyCondition.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abbce97698323494db627fef98477965 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListAttributeDrawer.cs index 40be98ea..6c105f8f 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListAttributeDrawer.cs @@ -17,7 +17,8 @@ static ReorderableListAttributeDrawer() a.FixedSize, a.Draggable, a.HasHeader, - a.HasLabels); + a.HasLabels, + a.Foldable); }); } diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListExposedAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListExposedAttributeDrawer.cs index 93834b2a..5063f642 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListExposedAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertyListDrawers/ReorderableListExposedAttributeDrawer.cs @@ -21,7 +21,8 @@ static ReorderableListExposedAttributeDrawer() a.FixedSize, a.Draggable, a.HasHeader, - a.HasLabels); + a.HasLabels, + a.Foldable); //additionaly subscribe callbacks ConnectCallbacks(list, a); return list; diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertySelfDrawers/InLineEditorAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertySelfDrawers/InLineEditorAttributeDrawer.cs index 7c87c101..44e222a6 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertySelfDrawers/InLineEditorAttributeDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/PropertySelfDrawers/InLineEditorAttributeDrawer.cs @@ -39,6 +39,22 @@ static InLineEditorAttributeDrawer() private static readonly PropertyDataStorage storage; + private Editor GetTargetsEditor(SerializedProperty property, InLineEditorAttribute attribute) + { + var editor = storage.ReturnItem(property, attribute); + if (editor.target != property.objectReferenceValue) + { + editor = storage.CreateItem(property, attribute); + } + + return editor; + } + + private bool GetInspectorToggle(SerializedProperty property) + { + return GUILayout.Toggle(property.isExpanded, Style.foldoutContent, Style.foldoutStyle, Style.foldoutOptions); + } + private void DrawEditor(Editor editor, InLineEditorAttribute attribute) { using (new EditorGUILayout.VerticalScope(Style.backgroundStyle)) @@ -109,22 +125,13 @@ protected override void OnGuiSafe(SerializedProperty property, GUIContent label, return; } - property.isExpanded = GUILayout.Toggle(property.isExpanded, - Style.foldoutContent, - Style.foldoutStyle, - Style.foldoutOptions); + property.isExpanded = GetInspectorToggle(property); } //create additional Editor for the associated reference if (property.isExpanded) { - var editor = storage.ReturnItem(property, attribute); - if (editor.target != property.objectReferenceValue) - { - //validate target value change (e.g. list reorder) - editor = storage.CreateItem(property, attribute); - } - + var editor = GetTargetsEditor(property, attribute); InspectorUtility.SetIsEditorExpanded(editor, true); //make useage of the created (cached) Editor instance using (new FixedFieldsScope()) diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs new file mode 100644 index 00000000..d577b805 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs @@ -0,0 +1,8 @@ +namespace Toolbox.Editor.Drawers +{ + /// + /// Base class for all drawers based on custom attributes. + /// + public abstract class ToolboxAttributeDrawer : ToolboxDrawer + { } +} diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs.meta b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs.meta new file mode 100644 index 00000000..22d61bb6 --- /dev/null +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxAttributeDrawer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0dff0704660db944cbbfb79bdd6791b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawer.cs index 672f778f..189b8158 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawer.cs @@ -21,7 +21,6 @@ public override sealed PropertyCondition OnGuiValidate(SerializedProperty proper return OnGuiValidate(property, attribute as T); } - public PropertyCondition OnGuiValidate(SerializedProperty property, T attribute) { if (attribute == null) diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawerBase.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawerBase.cs index 26c1f5f0..a5b270cd 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawerBase.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxConditionDrawerBase.cs @@ -3,13 +3,6 @@ namespace Toolbox.Editor.Drawers { - public enum PropertyCondition - { - Valid, - NonValid, - Disabled - } - public abstract class ToolboxConditionDrawerBase : ToolboxAttributeDrawer { public abstract PropertyCondition OnGuiValidate(SerializedProperty property); diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDecoratorDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDecoratorDrawer.cs index ddc64267..2830722e 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDecoratorDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDecoratorDrawer.cs @@ -27,7 +27,6 @@ public override sealed void OnGuiClose(ToolboxAttribute attribute) OnGuiClose(attribute as T); } - public void OnGuiBegin(T attribute) { if (attribute == null) diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDrawer.cs index 6bc54b66..e4d1056d 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxDrawer.cs @@ -5,10 +5,4 @@ /// public abstract class ToolboxDrawer { } - - /// - /// Base class for all drawers based on custom attributes. - /// - public abstract class ToolboxAttributeDrawer : ToolboxDrawer - { } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxListPropertyDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxListPropertyDrawer.cs index 48865424..a767b7f3 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxListPropertyDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxListPropertyDrawer.cs @@ -7,7 +7,6 @@ public abstract class ToolboxListPropertyDrawer : ToolboxPropertyDrawer wh { public override bool IsPropertyValid(SerializedProperty property) { - //NOTE: this will be always true since the ToolboxPropertyHandler will validate each drawer return property.isArray; } } diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawer.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawer.cs index 03dbf3c7..fe8d693c 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawer.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawer.cs @@ -26,7 +26,6 @@ public override sealed void OnGui(SerializedProperty property, GUIContent label, OnGui(property, label, attribute as T); } - public void OnGui(SerializedProperty property, GUIContent label, T attribute) { if (attribute == null) @@ -37,15 +36,14 @@ public void OnGui(SerializedProperty property, GUIContent label, T attribute) if (IsPropertyValid(property)) { OnGuiSafe(property, label, attribute); + return; } - else - { - var warningContent = new GUIContent(property.displayName + " has invalid property drawer"); - //create additional warning log to the console window - ToolboxEditorLog.WrongAttributeUsageWarning(attribute, property); - //create additional warning label based on the property name - ToolboxEditorGui.DrawEmptyProperty(property, warningContent); - } + + var warningContent = new GUIContent(string.Format("{0} has invalid property drawer", property.displayName)); + //create additional warning log to the Console window + ToolboxEditorLog.WrongAttributeUsageWarning(attribute, property); + //create additional warning label based on the property name + ToolboxEditorGui.DrawEmptyProperty(property, warningContent); } } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawerBase.cs b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawerBase.cs index eabd4307..3f1347c8 100644 --- a/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawerBase.cs +++ b/Assets/Editor Toolbox/Editor/Drawers/ToolboxDrawers/ToolboxPropertyDrawerBase.cs @@ -11,7 +11,6 @@ public abstract class ToolboxPropertyDrawerBase : ToolboxAttributeDrawer public abstract void OnGui(SerializedProperty property, GUIContent label, ToolboxAttribute attribute); - public virtual void OnGuiReload() { } } diff --git a/Assets/Editor Toolbox/Editor/Internal/ReorderableList.cs b/Assets/Editor Toolbox/Editor/Internal/ReorderableList.cs index 94b2da63..dd4e520f 100644 --- a/Assets/Editor Toolbox/Editor/Internal/ReorderableList.cs +++ b/Assets/Editor Toolbox/Editor/Internal/ReorderableList.cs @@ -37,10 +37,14 @@ public ReorderableList(SerializedProperty list, string elementLabel, bool dragga : base(list, elementLabel, draggable, hasHeader, fixedSize) { } - public ReorderableList(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels) + public ReorderableList(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels) : base(list, elementLabel, draggable, hasHeader, fixedSize, hasLabels) { } + public ReorderableList(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels, bool foldable) + : base(list, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable) + { } + protected override void DoListMiddle() { @@ -79,7 +83,7 @@ protected override void DoListMiddle(Rect middleRect) var elementContentRect = itemElementRect; //handle empty or invalid list - if (List == null || List.isArray == false || arraySize == 0) + if (!IsPropertyValid || !IsExpanded || IsEmpty) { //there was no content, so we will draw an empty element itemElementRect.y = middleRect.y; diff --git a/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs b/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs index cafdb066..5117d856 100644 --- a/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs +++ b/Assets/Editor Toolbox/Editor/Internal/ReorderableListBase.cs @@ -74,6 +74,10 @@ public ReorderableListBase(SerializedProperty list, string elementLabel, bool dr { } public ReorderableListBase(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels) + : this(list, elementLabel, draggable, hasHeader, fixedSize, hasLabels, false) + { } + + public ReorderableListBase(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels, bool foldable) { //validate parameters if (list == null || list.isArray == false) @@ -88,10 +92,10 @@ public ReorderableListBase(SerializedProperty list, string elementLabel, bool dr HasHeader = hasHeader; FixedSize = fixedSize; HasLabels = hasLabels; - //set other properties ElementLabel = elementLabel; + Foldable = foldable; - //ser serialized data + //set serialized data List = list; Size = list.FindPropertyRelative("Array.size"); @@ -501,7 +505,7 @@ public virtual void DoList() } - #region Methods: Default interaction/draw calls + #region Methods: Default interaction/draw calls/controls /// /// Draws the default Footer. @@ -575,6 +579,33 @@ public virtual void DrawStandardFooterBackground(Rect rect) } } + public virtual void DrawStandardName(Rect rect, GUIContent label, bool foldable) + { + if (foldable) + { + DrawStandardFoldout(rect, label); + } + else + { + DrawStandardLabel(rect, label); + } + } + + public virtual void DrawStandardLabel(Rect rect, GUIContent label) + { + EditorGUI.LabelField(rect, label, Style.namePropertyStyle); + } + + public virtual void DrawStandardFoldout(Rect rect, GUIContent label) + { + var style = Style.foldoutLabelStyle; + var leftPadding = style.padding.left; + style.CalcMinMaxWidth(label, out var minWidth, out _); + rect.xMin += leftPadding; + rect.xMax -= rect.width - minWidth; + List.isExpanded = EditorGUI.Foldout(rect, List.isExpanded, label, true, style); + } + /// /// Draws the default Header. /// @@ -582,13 +613,11 @@ public virtual void DrawStandardHeader(Rect rect) { var label = EditorGUI.BeginProperty(rect, TitleLabel, List); //display the property label using the preprocessed name - EditorGUI.LabelField(rect, label, Style.namePropertyStyle); + DrawStandardName(rect, label, Foldable); var diff = rect.height - Style.sizePropertyStyle.fixedHeight; - //adjust OY position to the middle of the element row rect.yMin += diff / 2; rect.yMax -= diff / 2; - //adjust OX position and width for the size property rect.xMin = rect.xMax - Style.sizeAreaWidth; using (new EditorGUI.DisabledScope(FixedSize)) @@ -597,14 +626,16 @@ public virtual void DrawStandardHeader(Rect rect) EditorGUI.BeginProperty(rect, Style.sizePropertyContent, property); EditorGUI.BeginChangeCheck(); - //cache a delayed size value using the delayed int field + //cache the size value using the delayed int field var sizeValue = Mathf.Max(EditorGUI.DelayedIntField(rect, property.intValue, Style.sizePropertyStyle), 0); if (EditorGUI.EndChangeCheck()) { property.intValue = sizeValue; } + EditorGUI.EndProperty(); } + EditorGUI.EndProperty(); } @@ -685,7 +716,7 @@ public virtual void DrawStandardElementBackground(Rect rect, int index, bool sel /// - /// Index of the currently active element. + /// Index of the currently active (hovered) element. /// public int Index { @@ -716,6 +747,9 @@ public int Count } } + /// + /// Indicates if list should allow dragging elements. + /// public bool Draggable { get; set; @@ -726,11 +760,38 @@ public bool IsDragging get; protected set; } - public virtual bool FixedSize { get; set; } = true; + /// + /// Indicates if list should be able to fold itself. + /// + public bool Foldable + { + get; set; + } - public virtual bool HasHeader { get; set; } = true; + public bool IsExpanded + { + get => List.isExpanded || !Foldable; + } + + public bool IsEmpty + { + get => Count == 0; + } + + public bool IsPropertyValid + { + get => List != null && List.isArray; + } + + /// + /// Indicates if list should have add/remove controls. + /// + public bool FixedSize { get; set; } + + public bool HasHeader { get; set; } = true; + + public bool HasLabels { get; set; } = true; - public virtual bool HasLabels { get; set; } = true; #if UNITY_2020_1_OR_NEWER public virtual float HeaderHeight { get; set; } = 20.0f; #else @@ -816,6 +877,7 @@ protected static class Style internal static readonly float handleHeight = 7.0f; internal static readonly float dragAreaWidth = 40.0f; internal static readonly float sizeAreaWidth = 19.0f; + internal static readonly float minEmptyHeight = 8.0f; internal static readonly GUIContent sizePropertyContent; internal static readonly GUIContent iconToolbarAddContent; @@ -824,7 +886,9 @@ protected static class Style internal static readonly GUIContent emptyOrInvalidListContent; internal static readonly GUIStyle namePropertyStyle; + internal static readonly GUIStyle foldoutLabelStyle; internal static readonly GUIStyle sizePropertyStyle; + internal static readonly GUIStyle contentGroupStyle; internal static readonly GUIStyle footerButtonStyle; internal static readonly GUIStyle dragHandleButtonStyle; internal static readonly GUIStyle headerBackgroundStyle; @@ -844,6 +908,10 @@ static Style() { alignment = TextAnchor.MiddleLeft }; + foldoutLabelStyle = new GUIStyle(EditorStyles.foldout) + { + alignment = TextAnchor.MiddleLeft + }; sizePropertyStyle = new GUIStyle(EditorStyles.miniTextField) { alignment = TextAnchor.MiddleRight, @@ -853,7 +921,9 @@ static Style() fontSize = 10 #endif }; + contentGroupStyle = new GUIStyle(EditorStyles.inspectorFullWidthMargins); + //built-in styles related to the ReorderableList controls footerButtonStyle = new GUIStyle("RL FooterButton"); dragHandleButtonStyle = new GUIStyle("RL DragHandle"); headerBackgroundStyle = new GUIStyle("RL Header"); diff --git a/Assets/Editor Toolbox/Editor/Internal/ToolboxEditorList.cs b/Assets/Editor Toolbox/Editor/Internal/ToolboxEditorList.cs index 41374ae4..a6d79b45 100644 --- a/Assets/Editor Toolbox/Editor/Internal/ToolboxEditorList.cs +++ b/Assets/Editor Toolbox/Editor/Internal/ToolboxEditorList.cs @@ -39,6 +39,10 @@ public ToolboxEditorList(SerializedProperty list, string elementLabel, bool drag : base(list, elementLabel, draggable, hasHeader, fixedSize, hasLabels) { } + public ToolboxEditorList(SerializedProperty list, string elementLabel, bool draggable, bool hasHeader, bool fixedSize, bool hasLabels, bool foldable) + : base(list, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable) + { } + private void ValidateElementsRects(int arraySize) { @@ -95,9 +99,8 @@ private void DrawElementRow(int index, bool isActive, bool isTarget, bool hasFoc } } - var style = EditorStyles.inspectorFullWidthMargins; //draw the real property in separate vertical group - using (var elementGroup = new EditorGUILayout.VerticalScope(style)) + using (var elementGroup = new EditorGUILayout.VerticalScope(Style.contentGroupStyle)) { var elementRect = elementGroup.rect; //adjust label width to the known dragging area @@ -120,10 +123,9 @@ private void DrawElementRow(int index, bool isActive, bool isTarget, bool hasFoc private void DrawVacantList() { - var style = EditorStyles.inspectorFullWidthMargins; - using (var vacantGroup = new EditorGUILayout.VerticalScope(style)) + using (var emptyListGroup = new EditorGUILayout.VerticalScope(Style.contentGroupStyle)) { - var rect = EditorGUILayout.GetControlRect(GUILayout.Height(Style.lineHeight)); + var rect = EditorGUILayout.GetControlRect(GUILayout.Height(Style.minEmptyHeight)); if (drawVacantCallback != null) { drawVacantCallback(rect); @@ -228,43 +230,42 @@ protected override void DoListMiddle(Rect middleRect) //make sure rects array is valid ValidateElementsRects(arraySize); //handle empty or invalid array - if (List == null || List.isArray == false || arraySize == 0) + if (!IsPropertyValid || !IsExpanded || IsEmpty) { DrawVacantList(); + return; } - else + + DrawEmptySpace(Style.padding); + //if there are elements, we need to draw them - we will do + //this differently depending on if we are dragging or not + for (var i = 0; i < arraySize; i++) { - DrawEmptySpace(Style.padding); - //if there are elements, we need to draw them - we will do - //this differently depending on if we are dragging or not - for (var i = 0; i < arraySize; i++) - { - //cache related properties - var isActive = (i == Index); - var hasFocus = (i == Index && HasKeyboardFocus()); - var isTarget = (i == lastCoveredIndex && !isActive); - var isEnding = (i == arraySize - 1); + //cache related properties + var isActive = (i == Index); + var hasFocus = (i == Index && HasKeyboardFocus()); + var isTarget = (i == lastCoveredIndex && !isActive); + var isEnding = (i == arraySize - 1); - //draw current array element - DrawElementRow(i, isActive, isTarget, hasFocus); + //draw current array element + DrawElementRow(i, isActive, isTarget, hasFocus); - //draw dragging target gap - if (isTarget) - { - DrawTargetGap(i, Index, GapColor, GapWidth, Style.dragAreaWidth); - } - - if (isEnding) - { - continue; - } + //draw dragging element gap + if (isTarget) + { + DrawTargetGap(i, Index, GapColor, GapWidth, Style.dragAreaWidth); + } - //create spacing for elements - DrawEmptySpace(ElementSpacing); + if (isEnding) + { + continue; } - DrawEmptySpace(Style.padding); + //create spacing for elements + DrawEmptySpace(ElementSpacing); } + + DrawEmptySpace(Style.padding); } protected override bool DoListHeader() @@ -351,7 +352,8 @@ protected override int GetCoveredElementIndex(Vector2 mousePosition) public override void DrawStandardElement(Rect rect, int index, bool selected, bool focused, bool draggable) { var element = List.GetArrayElementAtIndex(index); - ToolboxEditorGui.DrawToolboxProperty(element, GetElementContent(element, index)); + var content = GetElementContent(element, index); + ToolboxEditorGui.DrawToolboxProperty(element, content); } #endregion diff --git a/Assets/Editor Toolbox/Editor/ToolboxEditorGui.cs b/Assets/Editor Toolbox/Editor/ToolboxEditorGui.cs index 977f1d2b..ad3f75c2 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxEditorGui.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxEditorGui.cs @@ -261,18 +261,18 @@ public static partial class ToolboxEditorGui /// /// Creates using standard background. /// - public static ReorderableListBase CreateRoundList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true) + public static ReorderableListBase CreateRoundList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true, bool foldable = false) { - return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels); + return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable); } /// /// Creates using a non-standard (boxed style) background. /// - public static ReorderableListBase CreateBoxedList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true) + public static ReorderableListBase CreateBoxedList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true, bool foldable = false) { var backgroundStyle = new GUIStyle("box"); - return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels) + return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable) { drawHeaderBackgroundCallback = (Rect rect) => { @@ -308,9 +308,9 @@ public static ReorderableListBase CreateBoxedList(SerializedProperty property, s /// /// Creates using a non-standard (lined style) background. /// - public static ReorderableListBase CreateLinedList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true) + public static ReorderableListBase CreateLinedList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true, bool foldable = false) { - return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels) + return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable) { drawHeaderBackgroundCallback = (Rect rect) => { @@ -339,9 +339,9 @@ public static ReorderableListBase CreateLinedList(SerializedProperty property, s /// /// Creates without any additional background. /// - public static ReorderableListBase CreateClearList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true) + public static ReorderableListBase CreateClearList(SerializedProperty property, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true, bool foldable = false) { - return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels) + return new ToolboxEditorList(property, elementLabel, draggable, hasHeader, fixedSize, hasLabels, foldable) { drawHeaderBackgroundCallback = (Rect rect) => { }, @@ -360,13 +360,13 @@ public static ReorderableListBase CreateClearList(SerializedProperty property, s /// /// Creates using provided type. /// - public static ReorderableListBase CreateList(SerializedProperty property, ListStyle style, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true) + public static ReorderableListBase CreateList(SerializedProperty property, ListStyle style, string elementLabel = null, bool fixedSize = false, bool draggable = true, bool hasHeader = true, bool hasLabels = true, bool foldable = false) { switch (style) { - case ListStyle.Boxed: return CreateBoxedList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels); - case ListStyle.Lined: return CreateLinedList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels); - case ListStyle.Round: return CreateRoundList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels); + case ListStyle.Boxed: return CreateBoxedList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels, foldable); + case ListStyle.Lined: return CreateLinedList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels, foldable); + case ListStyle.Round: return CreateRoundList(property, elementLabel, fixedSize, draggable, hasHeader, hasLabels, foldable); default: return null; } } diff --git a/Assets/Editor Toolbox/Editor/ToolboxLayoutHelper.cs b/Assets/Editor Toolbox/Editor/ToolboxLayoutHelper.cs index bc6974d1..8633178f 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxLayoutHelper.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxLayoutHelper.cs @@ -7,7 +7,7 @@ namespace Toolbox.Editor /// /// Helper class to handle and validate creation of and groups. - /// Remark: can be used only within the Toolbox Editors. + /// Remark: can be used only within the Toolbox Editors. /// [InitializeOnLoad] internal static class ToolboxLayoutHelper diff --git a/Assets/Editor Toolbox/Editor/ToolboxPropertyHandler.cs b/Assets/Editor Toolbox/Editor/ToolboxPropertyHandler.cs index f367de8d..cfdc26f9 100644 --- a/Assets/Editor Toolbox/Editor/ToolboxPropertyHandler.cs +++ b/Assets/Editor Toolbox/Editor/ToolboxPropertyHandler.cs @@ -156,6 +156,7 @@ private void ProcessToolboxData() decoratorAttributes.Sort((a1, a2) => a1.Order.CompareTo(a2.Order)); hasToolboxDecoratorDrawer = true; } + //check if property has custom conditon drawer hasToolboxConditionDrawer = conditionAttribute != null; } @@ -165,10 +166,10 @@ private void HandleNewAttribute(ToolboxAttribute attribute) switch (attribute) { case ToolboxListPropertyAttribute a: - TryAssignPropertyAttribute(a); + TryAssignListPropertyAttribute(a); break; case ToolboxSelfPropertyAttribute a: - TryAssignPropertyAttribute(a); + TryAssignSelfPropertyAttribute(a); break; case ToolboxDecoratorAttribute a: TryAssignDecoratorAttribute(a); @@ -176,7 +177,7 @@ private void HandleNewAttribute(ToolboxAttribute attribute) case ToolboxConditionAttribute a: TryAssignConditionAttribute(a); break; - case ToolboxCompositionAttribute a: + case ToolboxArchetypeAttribute a: var composition = a.Process(); foreach (var newAttribute in composition) { @@ -186,10 +187,10 @@ private void HandleNewAttribute(ToolboxAttribute attribute) } } - private bool TryAssignPropertyAttribute(ToolboxListPropertyAttribute attribute) + private bool TryAssignBasePropertyAttribute(ToolboxPropertyAttribute attribute) { - //we can only have one property attribute for an array property - if (propertyAttribute != null || !isArray) + //NOTE: we can only have one property attribute + if (propertyAttribute != null) { return false; } @@ -200,18 +201,14 @@ private bool TryAssignPropertyAttribute(ToolboxListPropertyAttribute attribute) } } - private bool TryAssignPropertyAttribute(ToolboxSelfPropertyAttribute attribute) + private bool TryAssignListPropertyAttribute(ToolboxListPropertyAttribute attribute) { - //we can only have one property attribute for a non-array property - if (propertyAttribute != null || isArray) - { - return false; - } - else - { - propertyAttribute = attribute; - return true; - } + return isArray && TryAssignBasePropertyAttribute(attribute); + } + + private bool TryAssignSelfPropertyAttribute(ToolboxSelfPropertyAttribute attribute) + { + return !isArray && TryAssignBasePropertyAttribute(attribute); } private bool TryAssignDecoratorAttribute(ToolboxDecoratorAttribute attribute) diff --git a/Assets/Editor Toolbox/Editor/Utilities/GuiLayoutUtility.cs b/Assets/Editor Toolbox/Editor/Utilities/GuiLayoutUtility.cs index e02cb786..5967ba7c 100644 --- a/Assets/Editor Toolbox/Editor/Utilities/GuiLayoutUtility.cs +++ b/Assets/Editor Toolbox/Editor/Utilities/GuiLayoutUtility.cs @@ -16,7 +16,7 @@ public static class GuiLayoutUtility public static void BeginStrechedVertical() { - BeginFixedVertical(new GUIStyle()); + BeginFixedVertical(GUIStyle.none); } public static void BeginFixedVertical(GUIStyle style) diff --git a/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs b/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs index a3fa7a73..36803a2e 100644 --- a/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs +++ b/Assets/Editor Toolbox/Editor/Utilities/InspectorUtility.cs @@ -40,7 +40,6 @@ static InspectorUtility() }; } - private static Editor validationEditor; private static Editor lastCachedEditor; diff --git a/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs b/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs index b7861a36..0d3be0b9 100644 --- a/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs +++ b/Assets/Editor Toolbox/Editor/Utilities/ReflectionUtility.cs @@ -9,6 +9,7 @@ internal static class ReflectionUtility { private readonly static Assembly editorAssembly = typeof(UnityEditor.Editor).Assembly; + /// /// Returns of the searched method within the Editor . /// diff --git a/Assets/Editor Toolbox/EditorSettings.asset b/Assets/Editor Toolbox/EditorSettings.asset index 0d1e0f7f..de280c5e 100644 --- a/Assets/Editor Toolbox/EditorSettings.asset +++ b/Assets/Editor Toolbox/EditorSettings.asset @@ -57,6 +57,7 @@ MonoBehaviour: - classReference: Toolbox.Editor.Drawers.EndHorizontalAttributeDrawer, Toolbox-Editor - classReference: Toolbox.Editor.Drawers.EndHorizontalGroupAttributeDrawer, Toolbox-Editor - classReference: Toolbox.Editor.Drawers.EndIndentAttributeDrawer, Toolbox-Editor + - classReference: Toolbox.Editor.Drawers.GuiColorAttributeDrawer, Toolbox-Editor - classReference: Toolbox.Editor.Drawers.HelpAttributeDrawer, Toolbox-Editor - classReference: Toolbox.Editor.Drawers.HighlightAttributeDrawer, Toolbox-Editor - classReference: Toolbox.Editor.Drawers.ImageAreaAttributeDrawer, Toolbox-Editor diff --git a/Assets/Editor Toolbox/README.md b/Assets/Editor Toolbox/README.md index 190c5fe6..6d254dff 100644 --- a/Assets/Editor Toolbox/README.md +++ b/Assets/Editor Toolbox/README.md @@ -243,6 +243,15 @@ public SampleClass1 var1; ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/lefttoggle.png) +#### FormattedNumberAttribute + +```csharp +[FormattedNumber] +public int bigNumber; +``` + +![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/formattednumber.png) + --- ### Toolbox Drawers @@ -405,14 +414,14 @@ public GameObject[] largeArray = new GameObject[19]; ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scrollableitems.png) -#### ToolboxCompositionAttributes +#### ToolboxArchetypeAttributes Using this attribute you are able to implement custom patterns of frequently grouped **ToolboxAttributes**. ```csharp [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] -public class TitleAttribute : ToolboxCompositionAttribute +public class TitleAttribute : ToolboxArchetypeAttribute { public TitleAttribute(string label) { @@ -457,7 +466,7 @@ public Canvas[] vars1; ``` ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/list4.png) ```csharp -[ReorderableList(ListStyle.Lined, "Item")] +[ReorderableList(ListStyle.Lined, "Item", Foldable = false)] public List linedStyleList; ``` ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/list1.png) @@ -533,7 +542,7 @@ public void Usage() dictionary.Add(3, new GameObject("TestObject")); dictionary.ContainsKey(2); //etc. like standard System.Collections.Generic.Dictionary<> - var nativeDictionary = dictionary.BuiltNativeDictionary(); + var nativeDictionary = dictionary.BuildNativeDictionary(); } #endif ``` diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/AssetPreviewAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/AssetPreviewAttribute.cs index 5806142d..163e2d37 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/AssetPreviewAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/AssetPreviewAttribute.cs @@ -12,15 +12,15 @@ public class AssetPreviewAttribute : PropertyAttribute { public AssetPreviewAttribute(float width = 64, float height = 64, bool useLabel = true) { - Height = height; Width = width; + Height = height; UseLabel = useLabel; } - public float Height { get; private set; } - public float Width { get; private set; } + public float Height { get; private set; } + public bool UseLabel { get; private set; } } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs new file mode 100644 index 00000000..73f16533 --- /dev/null +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs @@ -0,0 +1,33 @@ +using System; + +namespace UnityEngine +{ + /// + /// Creates customized property field for numeric values. + /// + /// + /// Supported formats: + /// + /// MS documentation + /// + /// + /// + /// Supported types: , , . + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] + public class FormattedNumberAttribute : PropertyAttribute + { + public FormattedNumberAttribute(string format = "n") + { + Format = format; + } + + public string Format { get; private set; } + + /// + /// Indicates number of visible decimals in the text field. + /// For this property will be always ignored. + /// + public int DecimalsToShow { get; set; } = 2; + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs.meta b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs.meta new file mode 100644 index 00000000..3ea181f6 --- /dev/null +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0470a26cf0d6fec48b0f28a192159a43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs deleted file mode 100644 index 65bb6edc..00000000 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/IndentAttribute.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -namespace UnityEngine -{ - /// - /// Creates indent scope. - /// - /// Supported types: all. - /// - [Obsolete("Use IndentAreaAttribute instead.")] - [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] - public class IndentAttribute : PropertyAttribute - { - public IndentAttribute() - { - IndentLevelChange = 1; - } - - public IndentAttribute(int indentLevelChange) - { - IndentLevelChange = indentLevelChange; - } - - public int IndentLevelChange { get; private set; } - } -} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/NotNullAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/NotNullAttribute.cs index 59f9ca1b..122403d4 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/NotNullAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/NotNullAttribute.cs @@ -10,10 +10,8 @@ namespace UnityEngine [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class NotNullAttribute : PropertyAttribute { - public NotNullAttribute() - { - Label = "Variable has to be assigned."; - } + public NotNullAttribute() : this("Variable has to be assigned.") + { } public NotNullAttribute(string label) { diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ProgressBarAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ProgressBarAttribute.cs index 5814abac..8f467dfa 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ProgressBarAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ProgressBarAttribute.cs @@ -18,24 +18,19 @@ public ProgressBarAttribute(string name = "", float minValue = 0, float maxValue MaxValue = Mathf.Max(maxValue, minValue); } - public Color GetBarColor() - { - if (ColorUtility.TryParseHtmlString(HexColor, out var color)) - { - return color; - } - else - { - return new Color(0.28f, 0.38f, 0.88f); - } - } - public string Name { get; private set; } - public string HexColor { get; set; } - public float MinValue { get; private set; } public float MaxValue { get; private set; } + + public Color Color + { + get => ColorUtility.TryParseHtmlString(HexColor, out var color) + ? color + : new Color(0.28f, 0.38f, 0.88f); + } + + public string HexColor { get; set; } } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs deleted file mode 100644 index 89f41776..00000000 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/SeparatorAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace UnityEngine -{ - [Obsolete("Use LineAttribute instead.")] - [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] - public class SeparatorAttribute : PropertyAttribute - { - public SeparatorAttribute(float thickness = 0.75f, float padding = 6.0f) - { - //validate the thickness property - Thickness = Mathf.Max(thickness, 0); - //validate the padding property - Padding = Mathf.Max(padding, 0); - } - - public float Thickness { get; private set; } - - public float Padding { get; private set; } - } -} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/TypeConstraintAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/TypeConstraintAttribute.cs index f214bb04..80ac3717 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/TypeConstraintAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/TypeConstraintAttribute.cs @@ -6,31 +6,6 @@ namespace UnityEngine { - /// - /// Indicates how selectable classes should be collated in drop-down menu. - /// - public enum ClassGrouping - { - /// - /// No grouping, just show type names in a list; for instance, "Some.Nested.Namespace.SpecialClass". - /// - None, - /// - /// Group classes by namespace and show foldout menus for nested namespaces; for - /// instance, "Some > Nested > Namespace > SpecialClass". - /// - ByNamespace, - /// - /// Group classes by namespace; for instance, "Some.Nested.Namespace > SpecialClass". - /// - ByNamespaceFlat, - /// - /// Group classes in the same way as Unity does for its component menu. This - /// grouping method must only be used for types. - /// - ByAddComponentMenu, - } - /// /// Allows to pick proper type using popup control. /// @@ -205,4 +180,29 @@ public override bool IsConstraintSatisfied(Type type) return false; } } + + /// + /// Indicates how selectable classes should be collated in drop-down menu. + /// + public enum ClassGrouping + { + /// + /// No grouping, just show type names in a list; for instance, "Some.Nested.Namespace.SpecialClass". + /// + None, + /// + /// Group classes by namespace and show foldout menus for nested namespaces; for + /// instance, "Some > Nested > Namespace > SpecialClass". + /// + ByNamespace, + /// + /// Group classes by namespace; for instance, "Some.Nested.Namespace > SpecialClass". + /// + ByNamespaceFlat, + /// + /// Group classes in the same way as Unity does for its component menu. This + /// grouping method must only be used for types. + /// + ByAddComponentMenu, + } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes.meta b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes.meta similarity index 100% rename from Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes.meta rename to Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes.meta diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes/TitleAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes/TitleAttribute.cs similarity index 94% rename from Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes/TitleAttribute.cs rename to Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes/TitleAttribute.cs index c3cac633..f2ac4b36 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes/TitleAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes/TitleAttribute.cs @@ -9,7 +9,7 @@ namespace UnityEngine /// Standardized header, it's composition of the and the . /// [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] - public class TitleAttribute : ToolboxCompositionAttribute + public class TitleAttribute : ToolboxArchetypeAttribute { public TitleAttribute(string label) { diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes/TitleAttribute.cs.meta b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes/TitleAttribute.cs.meta similarity index 100% rename from Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/CompositionAttributes/TitleAttribute.cs.meta rename to Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ArchetypeAttributes/TitleAttribute.cs.meta diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs new file mode 100644 index 00000000..b381f770 --- /dev/null +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs @@ -0,0 +1,23 @@ +using System; + +namespace UnityEngine +{ + /// + /// Changes GUI color of all related controls (other decorators and the property field). + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] + public class GuiColorAttribute : ToolboxDecoratorAttribute + { + public GuiColorAttribute(float r, float g, float b) + { + Color = new Color(r, g, b); + } + + public GuiColorAttribute(string hexColor) + { + Color = ColorUtility.TryParseHtmlString(hexColor, out var color) ? color : Color.magenta; + } + + public Color Color { get; private set; } + } +} \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs.meta b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs.meta new file mode 100644 index 00000000..e7c00d85 --- /dev/null +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/GuiColorAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89ad57d8ceb925e4aa22cca5c0554b52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/HighlightAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/HighlightAttribute.cs index 22dabef3..2fa1acc4 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/HighlightAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/HighlightAttribute.cs @@ -12,12 +12,9 @@ public HighlightAttribute(float r, float g, float b) public HighlightAttribute(string hexColor) { - if (ColorUtility.TryParseHtmlString(hexColor, out var color)) - { - Color = color; - } + Color = ColorUtility.TryParseHtmlString(hexColor, out var color) ? color : Color.magenta; } - public Color Color { get; private set; } = Color.white; + public Color Color { get; private set; } } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/LabelAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/LabelAttribute.cs index 62d8b9bc..478e3e8b 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/LabelAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/LabelAttribute.cs @@ -17,22 +17,21 @@ public LabelAttribute(string label, FontStyle fontStyle = FontStyle.Bold, SkinSt public string Label { get; private set; } - /// - /// Name of the built-in icon that should be placed into the label. - /// - public string Asset { get; set; } - public FontStyle FontStyle { get; private set; } public SkinStyle SkinStyle { get; private set; } public TextAnchor Alignment { get; set; } = TextAnchor.MiddleLeft; + /// + /// Name of the built-in icon that should be placed into the label. + /// + public string Asset { get; set; } + /// /// Additional space to apply before the label field. /// public float SpaceBefore { get; set; } = 5.0f; - /// /// Additional space to apply after the label field. /// diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/SpaceAreaAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/SpaceAreaAttribute.cs index cdfa1733..7b7362f8 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/SpaceAreaAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/DecoratorAttributes/SpaceAreaAttribute.cs @@ -4,7 +4,7 @@ namespace UnityEngine { /// /// Extended version of the built-in . - /// Allows creating space before and after serialized field. + /// Creates additional space before and after serialized field. /// [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] public class SpaceAreaAttribute : ToolboxDecoratorAttribute diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/PropertyListAttributes/ReorderableListAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/PropertyListAttributes/ReorderableListAttribute.cs index 076edcef..b0aeabae 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/PropertyListAttributes/ReorderableListAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/PropertyListAttributes/ReorderableListAttribute.cs @@ -18,14 +18,23 @@ public ReorderableListAttribute(ListStyle style = ListStyle.Round, string elemen ElementLabel = elementLabel; } - public bool HasHeader { get; set; } = true; - public bool HasLabels { get; set; } = true; public bool Draggable { get; private set; } public bool FixedSize { get; private set; } - public ListStyle ListStyle { get; private set; } - public string ElementLabel { get; private set; } + + /// + /// Indicates whether list should be allowed to fold in and out. + /// + public bool Foldable { get; set; } + /// + /// Indicates whether list should have a label above elements. + /// + public bool HasHeader { get; set; } = true; + /// + /// Indicates whether each element should have an additional label. + /// + public bool HasLabels { get; set; } = true; } public enum ListStyle diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxCompositionAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxArchetypeAttribute.cs similarity index 83% rename from Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxCompositionAttribute.cs rename to Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxArchetypeAttribute.cs index 0298aaff..53682a54 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxCompositionAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxArchetypeAttribute.cs @@ -6,7 +6,7 @@ namespace UnityEngine /// Base class for all attributes responsible for the creation of dedicated composition of s. /// [AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)] - public abstract class ToolboxCompositionAttribute : ToolboxAttribute + public abstract class ToolboxArchetypeAttribute : ToolboxAttribute { public abstract ToolboxAttribute[] Process(); } diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxCompositionAttribute.cs.meta b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxArchetypeAttribute.cs.meta similarity index 100% rename from Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxCompositionAttribute.cs.meta rename to Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxArchetypeAttribute.cs.meta diff --git a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxAttribute.cs b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxAttribute.cs index 56dcab0d..0a229654 100644 --- a/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxAttribute.cs +++ b/Assets/Editor Toolbox/Scripts/Attributes/ToolboxAttributes/ToolboxAttribute.cs @@ -1,8 +1,10 @@ -namespace UnityEngine +using System; + +namespace UnityEngine { /// /// Base class for all attributes used within Component Editors. /// - public abstract class ToolboxAttribute : System.Attribute + public abstract class ToolboxAttribute : Attribute { } } \ No newline at end of file diff --git a/Assets/Editor Toolbox/Scripts/Serialization/SerializedDictionary.cs b/Assets/Editor Toolbox/Scripts/Serialization/SerializedDictionary.cs index e854321a..a65a9ad8 100644 --- a/Assets/Editor Toolbox/Scripts/Serialization/SerializedDictionary.cs +++ b/Assets/Editor Toolbox/Scripts/Serialization/SerializedDictionary.cs @@ -122,11 +122,17 @@ public void Clear() indexByKey.Clear(); } + [Obsolete("Use BuildNativeDictionary instead.")] public Dictionary BuiltNativeDictionary() { return new Dictionary(dictionary); } + public Dictionary BuildNativeDictionary() + { + return new Dictionary(dictionary); + } + void ICollection>.Add(KeyValuePair pair) { Add(pair.Key, pair.Value); diff --git a/Assets/Editor Toolbox/package.json b/Assets/Editor Toolbox/package.json index 114ca648..a6f276a9 100644 --- a/Assets/Editor Toolbox/package.json +++ b/Assets/Editor Toolbox/package.json @@ -1,7 +1,7 @@ { "name": "com.arimger.editor-toolbox", "displayName": "Editor Toolbox", - "version": "0.8.13", + "version": "0.9.0", "unity": "2018.1", "description": "Tools, custom attributes, drawers, hierarchy overlay, and other extensions for the Unity Editor.", "keywords": [ diff --git a/Assets/Examples/Scenes/SampleScene.unity b/Assets/Examples/Scenes/SampleScene.unity index d9192f71..a4120ed4 100644 --- a/Assets/Examples/Scenes/SampleScene.unity +++ b/Assets/Examples/Scenes/SampleScene.unity @@ -699,6 +699,8 @@ MonoBehaviour: scene: sceneReference: {fileID: 102900000, guid: f11034f4657f51a47aac14f26410c500, type: 3} buildIndex: 0 + bigNumber: 12345678 + currency: 20.41 --- !u!4 &959025299 Transform: m_ObjectHideFlags: 2 diff --git a/Assets/Examples/Scenes/SampleSceneSettings.lighting b/Assets/Examples/Scenes/SampleSceneSettings.lighting new file mode 100644 index 00000000..83d93342 --- /dev/null +++ b/Assets/Examples/Scenes/SampleSceneSettings.lighting @@ -0,0 +1,63 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SampleSceneSettings + serializedVersion: 3 + m_GIWorkflowMode: 1 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 512 + m_BakeResolution: 10 + m_Padding: 2 + m_TextureCompression: 1 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 256 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 diff --git a/Assets/Examples/Scenes/SampleSceneSettings.lighting.meta b/Assets/Examples/Scenes/SampleSceneSettings.lighting.meta new file mode 100644 index 00000000..052b4e5a --- /dev/null +++ b/Assets/Examples/Scenes/SampleSceneSettings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8aebe3ea7163bc84194ae1d81c850abb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Examples/Scripts/SampleBehaviour1.cs b/Assets/Examples/Scripts/SampleBehaviour1.cs index de44ed07..0cf0f74a 100644 --- a/Assets/Examples/Scripts/SampleBehaviour1.cs +++ b/Assets/Examples/Scripts/SampleBehaviour1.cs @@ -202,4 +202,11 @@ public class SampleClass2 [Label("26", skinStyle: SkinStyle.Box)] public SerializedScene scene; + + [Label("27", skinStyle: SkinStyle.Box)] + + [FormattedNumber] + public int bigNumber; + [FormattedNumber("c")] + public float currency; } \ No newline at end of file diff --git a/Assets/Examples/Scripts/SampleBehaviour2.cs b/Assets/Examples/Scripts/SampleBehaviour2.cs index bcbe00d9..3b909b10 100644 --- a/Assets/Examples/Scripts/SampleBehaviour2.cs +++ b/Assets/Examples/Scripts/SampleBehaviour2.cs @@ -167,7 +167,7 @@ public int GetValue() [Label("15", skinStyle: SkinStyle.Box)] [BeginHorizontalGroup(label: "Horizontal Group")] - [ReorderableList, InLineEditor] + [ReorderableList(Foldable = true), InLineEditor] public GameObject[] gameObjects; [SpaceArea] [EndHorizontalGroup] diff --git a/Docs/formattednumber.png b/Docs/formattednumber.png new file mode 100644 index 00000000..07993711 Binary files /dev/null and b/Docs/formattednumber.png differ diff --git a/Packages/manifest.json b/Packages/manifest.json index 5f5ff4a8..9247eafb 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,13 +1,22 @@ { "dependencies": { - "com.unity.ads": "2.0.8", - "com.unity.analytics": "3.2.3", - "com.unity.collab-proxy": "1.2.15", + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", + "com.unity.ads": "3.6.1", + "com.unity.analytics": "3.5.3", + "com.unity.collab-proxy": "1.3.9", "com.unity.editorcoroutines": "1.0.0", - "com.unity.package-manager-ui": "2.0.13", - "com.unity.purchasing": "2.0.3", - "com.unity.textmeshpro": "1.4.1", + "com.unity.ide.rider": "2.0.7", + "com.unity.ide.visualstudio": "2.0.7", + "com.unity.ide.vscode": "1.2.3", + "com.unity.purchasing": "2.2.2", + "com.unity.test-framework": "1.1.24", + "com.unity.textmeshpro": "3.0.1", + "com.unity.timeline": "1.4.6", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.1.7", "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json new file mode 100644 index 00000000..d88f2ff1 --- /dev/null +++ b/Packages/packages-lock.json @@ -0,0 +1,394 @@ +{ + "dependencies": { + "com.unity.2d.sprite": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.2d.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.ads": { + "version": "3.6.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.analytics": { + "version": "3.5.3", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.collab-proxy": { + "version": "1.3.9", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.editorcoroutines": { + "version": "1.0.0", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.ide.rider": { + "version": "2.0.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.1" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.vscode": { + "version": "1.2.3", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, + "com.unity.purchasing": { + "version": "2.2.2", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.test-framework": { + "version": "1.1.24", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.textmeshpro": { + "version": "3.0.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.timeline": { + "version": "1.4.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.xr.legacyinputhelpers": { + "version": "2.1.7", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.xr": "1.0.0" + }, + "url": "https://packages.unity.com" + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.uielementsnative": "1.0.0" + } + }, + "com.unity.modules.uielementsnative": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/ProjectSettings/PackageManagerSettings.asset b/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 00000000..be4a7974 --- /dev/null +++ b/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreviewPackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.com + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_ErrorMessage: + m_Original: + m_Id: + m_Name: + m_Url: + m_Scopes: [] + m_IsDefault: 0 + m_Capabilities: 0 + m_Modified: 0 + m_Name: + m_Url: + m_Scopes: + - + m_SelectedScopeIndex: 0 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index c59c4c9a..0cd78d8f 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 18 + serializedVersion: 22 productGUID: 8a5218c0d05cb524792aaa1333627b48 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 @@ -49,10 +49,11 @@ PlayerSettings: m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 - displayResolutionDialog: 1 iosUseCustomAppBackgroundBehavior: 0 iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 @@ -65,6 +66,7 @@ PlayerSettings: disableDepthAndStencilBuffers: 0 androidStartInFullscreen: 1 androidRenderOutsideSafeArea: 0 + androidUseSwappy: 0 androidBlitType: 0 defaultIsNativeResolution: 1 macRetinaSupport: 1 @@ -79,11 +81,11 @@ PlayerSettings: usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 + useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games gpuSkinning: 1 - graphicsJobs: 0 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 @@ -91,7 +93,6 @@ PlayerSettings: xboxEnableFitness: 0 visibleInBackground: 1 allowFullscreenSwitch: 1 - graphicsJobMode: 0 fullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 @@ -114,7 +115,12 @@ PlayerSettings: switchNVNOtherPoolsGranularity: 16777216 switchNVNMaxPublicTextureIDCount: 0 switchNVNMaxPublicSamplerIDCount: 0 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 0 + vulkanEnableLateAcquireNextImage: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 @@ -128,40 +134,26 @@ PlayerSettings: m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 1 xboxOneEnable7thCore: 1 - isWsaHolographicRemotingEnabled: 0 vrSettings: - cardboard: - depthFormat: 0 - enableTransitionView: 0 - daydream: - depthFormat: 0 - useSustainedPerformanceMode: 0 - enableVideoLayer: 0 - useProtectedVideoMemory: 0 - minimumSupportedHeadTracking: 0 - maximumSupportedHeadTracking: 1 - hololens: - depthFormat: 1 - depthBufferSharingEnabled: 1 - oculus: - sharedDepthBuffer: 1 - dashSupport: 1 - lowOverheadMode: 0 - protectedContext: 0 - v2Signing: 0 enable360StereoCapture: 0 - protectGraphicsMemory: 0 + isWsaHolographicRemotingEnabled: 0 enableFrameTimingStats: 0 useHDRDisplay: 0 + D3DHDRBitDepth: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 resolutionScalingMode: 0 androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 - applicationIdentifier: {} - buildNumber: {} + applicationIdentifier: + Standalone: com.BroWarCollective.EditorToolbox + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 0 AndroidBundleVersionCode: 1 - AndroidMinSdkVersion: 16 + AndroidMinSdkVersion: 19 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1 aotOptions: @@ -176,28 +168,16 @@ PlayerSettings: StripUnusedMeshComponents: 1 VertexChannelCompressionMask: 4054 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 9.0 + iOSTargetOSVersionString: 11.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 - tvOSTargetOSVersionString: 9.0 + tvOSTargetOSVersionString: 11.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 uIStatusBarHidden: 1 uIExitOnSuspend: 0 uIStatusBarStyle: 0 - iPhoneSplashScreen: {fileID: 0} - iPhoneHighResSplashScreen: {fileID: 0} - iPhoneTallHighResSplashScreen: {fileID: 0} - iPhone47inSplashScreen: {fileID: 0} - iPhone55inPortraitSplashScreen: {fileID: 0} - iPhone55inLandscapeSplashScreen: {fileID: 0} - iPhone58inPortraitSplashScreen: {fileID: 0} - iPhone58inLandscapeSplashScreen: {fileID: 0} - iPadPortraitSplashScreen: {fileID: 0} - iPadHighResPortraitSplashScreen: {fileID: 0} - iPadLandscapeSplashScreen: {fileID: 0} - iPadHighResLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] @@ -225,8 +205,8 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: - iOSUseLaunchScreenStoryboard: 0 iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] iOSBackgroundModes: 0 @@ -234,6 +214,7 @@ PlayerSettings: metalEditorSupport: 1 metalAPIValidation: 1 iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: @@ -243,9 +224,17 @@ PlayerSettings: iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 appleEnableProMotion: 0 + shaderPrecisionModel: 0 clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea templatePackageId: com.unity.template.3d@1.3.0 templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomProguardFile: 0 AndroidTargetArchitectures: 5 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -257,12 +246,17 @@ PlayerSettings: AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 - resolutionDialogBanner: {fileID: 0} + AndroidMinifyWithR8: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 m_BuildTargetIcons: [] m_BuildTargetPlatformIcons: [] m_BuildTargetBatching: @@ -281,6 +275,46 @@ PlayerSettings: - m_BuildTarget: WebGL m_StaticBatching: 0 m_DynamicBatching: 0 + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 0 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 0 + - m_BuildTarget: GameCoreScarlettSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 0 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: GameCoreXboxOneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 0 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: PS5Player + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 0 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: CloudRendering + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 m_BuildTargetGraphicsAPIs: - m_BuildTarget: AndroidPlayer m_APIs: 0b00000008000000 @@ -290,7 +324,7 @@ PlayerSettings: m_Automatic: 1 - m_BuildTarget: AppleTVSupport m_APIs: 10000000 - m_Automatic: 0 + m_Automatic: 1 - m_BuildTarget: WebGLSupport m_APIs: 0b000000 m_Automatic: 1 @@ -300,9 +334,9 @@ PlayerSettings: m_Devices: - Oculus - OpenVR - m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 + openGLRequireES32: 0 m_TemplateCustomTags: {} mobileMTRendering: Android: 1 @@ -310,6 +344,7 @@ PlayerSettings: tvOS: 1 m_BuildTargetGroupLightmapEncodingQuality: [] m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: [] playModeTestRunnerEnabled: 0 runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 @@ -319,12 +354,14 @@ PlayerSettings: cameraUsageDescription: locationUsageDescription: microphoneUsageDescription: + switchNMETAOverride: switchNetLibKey: switchSocketMemoryPoolSize: 6144 switchSocketAllocatorPoolSize: 128 switchSocketConcurrencyLimit: 14 switchScreenResolutionBehavior: 2 switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 switchApplicationID: 0x01004b9000490000 switchNSODependencies: switchTitleNames_0: @@ -342,6 +379,7 @@ PlayerSettings: switchTitleNames_12: switchTitleNames_13: switchTitleNames_14: + switchTitleNames_15: switchPublisherNames_0: switchPublisherNames_1: switchPublisherNames_2: @@ -357,6 +395,7 @@ PlayerSettings: switchPublisherNames_12: switchPublisherNames_13: switchPublisherNames_14: + switchPublisherNames_15: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -372,6 +411,7 @@ PlayerSettings: switchIcons_12: {fileID: 0} switchIcons_13: {fileID: 0} switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} switchSmallIcons_0: {fileID: 0} switchSmallIcons_1: {fileID: 0} switchSmallIcons_2: {fileID: 0} @@ -387,6 +427,7 @@ PlayerSettings: switchSmallIcons_12: {fileID: 0} switchSmallIcons_13: {fileID: 0} switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} switchManualHTML: switchAccessibleURLs: switchLegalInformation: @@ -449,6 +490,7 @@ PlayerSettings: switchSocketInitializeEnabled: 1 switchNetworkInterfaceManagerInitializeEnabled: 1 switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -488,6 +530,7 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4pnSessions: 1 ps4pnPresence: 1 @@ -500,6 +543,7 @@ PlayerSettings: ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 ps4SocialScreenEnabled: 0 ps4ScriptOptimizationLevel: 0 ps4Audio3dVirtualSpeakerCount: 14 @@ -520,9 +564,11 @@ PlayerSettings: ps4GPU800MHz: 1 ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 monoEnv: splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 spritePackerPolicy: webGLMemorySize: 256 webGLExceptionSupport: 1 @@ -535,17 +581,27 @@ PlayerSettings: webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 scriptingDefineSymbols: {} + additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: {} il2cppCompilerConfiguration: {} managedStrippingLevel: {} incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 allowUnsafeCode: 0 + useDeterministicCompilation: 1 + useReferenceAssemblies: 1 + enableRoslynAnalyzers: 1 additionalIl2CppArgs: scriptingRuntimeVersion: 1 + gcIncremental: 1 + assemblyVersionValidation: 1 + gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: {} m_RenderingPath: 1 m_MobileRenderingPath: 1 @@ -576,7 +632,6 @@ PlayerSettings: metroFTAName: metroFTAFileTypes: [] metroProtocolName: - metroCompilationOverrides: 1 XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -595,18 +650,16 @@ PlayerSettings: XboxOneCapability: [] XboxOneGameRating: {} XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 XboxOneEnableGPUVariability: 1 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 1 XboxOneOverrideIdentityName: - vrEditorSettings: - daydream: - daydreamIconForeground: {fileID: 0} - daydreamIconBackground: {fileID: 0} + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} cloudServicesEnabled: UNet: 1 luminIcon: @@ -615,24 +668,18 @@ PlayerSettings: m_PortalFolderPath: luminCert: m_CertPath: - m_PrivateKeyPath: + m_SignPackage: 1 luminIsChannelApp: 0 luminVersion: m_VersionCode: 1 m_VersionName: - facebookSdkVersion: 7.9.4 - facebookAppId: - facebookCookies: 1 - facebookLogging: 1 - facebookStatus: 1 - facebookXfbml: 0 - facebookFrictionlessRequests: 1 apiCompatibilityLevel: 6 + activeInputHandler: 0 cloudProjectId: 7c3cffca-cc4e-4f8f-93f7-97568a17fdbb framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] projectName: Editor Toolbox organizationId: whitefox-studio cloudEnabled: 0 - enableNativePlatformBackendsForNewInputSystem: 0 - disableOldInputManagerSupport: 0 legacyClampBlendShapeWeights: 0 + virtualTexturingSupportEnabled: 0 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 85c44c83..6260f2cc 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.4.26f1 +m_EditorVersion: 2020.3.2f1 +m_EditorVersionWithRevision: 2020.3.2f1 (8fd9074bf66c) diff --git a/ProjectSettings/VersionControlSettings.asset b/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 00000000..dca28814 --- /dev/null +++ b/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/README.md b/README.md index 190c5fe6..6d254dff 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,15 @@ public SampleClass1 var1; ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/lefttoggle.png) +#### FormattedNumberAttribute + +```csharp +[FormattedNumber] +public int bigNumber; +``` + +![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/formattednumber.png) + --- ### Toolbox Drawers @@ -405,14 +414,14 @@ public GameObject[] largeArray = new GameObject[19]; ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/scrollableitems.png) -#### ToolboxCompositionAttributes +#### ToolboxArchetypeAttributes Using this attribute you are able to implement custom patterns of frequently grouped **ToolboxAttributes**. ```csharp [AttributeUsage(AttributeTargets.Field, AllowMultiple = true)] -public class TitleAttribute : ToolboxCompositionAttribute +public class TitleAttribute : ToolboxArchetypeAttribute { public TitleAttribute(string label) { @@ -457,7 +466,7 @@ public Canvas[] vars1; ``` ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/list4.png) ```csharp -[ReorderableList(ListStyle.Lined, "Item")] +[ReorderableList(ListStyle.Lined, "Item", Foldable = false)] public List linedStyleList; ``` ![inspector](https://github.com/arimger/Unity-Editor-Toolbox/blob/develop/Docs/list1.png) @@ -533,7 +542,7 @@ public void Usage() dictionary.Add(3, new GameObject("TestObject")); dictionary.ContainsKey(2); //etc. like standard System.Collections.Generic.Dictionary<> - var nativeDictionary = dictionary.BuiltNativeDictionary(); + var nativeDictionary = dictionary.BuildNativeDictionary(); } #endif ``` diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset new file mode 100644 index 00000000..f7df0ccb Binary files /dev/null and b/UserSettings/EditorUserSettings.asset differ