Skip to content

Commit 8942b99

Browse files
authored
Merge pull request #115 from arimger/develop
Develop - 0.13.0
2 parents 6e0f089 + d7afe76 commit 8942b99

File tree

94 files changed

+2155
-678
lines changed

Some content is hidden

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

94 files changed

+2155
-678
lines changed

Assets/Editor Toolbox/CHANGELOG.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1+
## 0.13.0 [28.08.2024]
2+
3+
### Added:
4+
- Warning information if currently serialized type in TypeField-based drawers (SerializedType, [ReferencerPicker]) is not available in the filtered types collection
5+
- Context menu operations for [SerializeReference] properties (Copy, Paste, Duplicate), all operations are based on a deep copy of the source reference
6+
- Basic support for generic references while using [SerializeReference] & [ReferencePicker], can be utilized in Unity 2023.2.x+
7+
- More unit tests (PropertyUtility, filtering generic types)
8+
- Validation of assigned assets in the SerializedDirectory class
9+
10+
### Changed:
11+
- Fix duplicated initialization process forced by the OnValidate call
12+
- Better support for generic types for the SerializedType & associated drawer
13+
- Hierarchy: For now 'Script' label displays maximum 5 scripts
14+
- Improved types label generation for TypeField-based drawers (SerializedType, [ReferencerPicker])
15+
116
## 0.12.13 [22.08.2024]
217

18+
### Added:
19+
- DisableInEditModeAttribute
20+
321
### Changed:
422
- Hierarchy: Added Tree List renderer, which improves visual identification of parent and child gameobjects
523
- Hierarchy: For now 'Script' label will display all available components linked to a GameObject/Prefabs
624
- Hierarchy: For now 'Layer' label will display full layer name instead of the layer mask value
725
- Fix SceneView settings change events firing when they shouldn't
826
- Fix issue when trying to find private fields/properties from parent classes (e.g. while using conditional attributes)
927

10-
### Added:
11-
- DisableInEditModeAttribute
12-
1328
## 0.12.12 [17.06.2024]
1429

30+
### Added:
31+
- NotPrefabObjectOnlyAttribute
32+
1533
### Changed:
1634
- LabelWidthAttribute is now part of the Toolbox decorator attributes (can be mixed with other attributes)
1735
- Hierarchy: Script, Tag, and Layer columns are now excluded from the default settings
1836
- Possibility to change style for groups ([BeginGroup] and [BeginHorizontalGroup] attributes)
1937
- ScriptableObject Creation Wizard now accepts only ScriptableObjects marked with the [CreateInWizard] or [CreateAssetMenu] attributes
2038

21-
### Added:
22-
- NotPrefabObjectOnlyAttribute
23-
2439
## 0.12.11 [05.04.2024]
2540

2641
### Changed:
@@ -53,13 +68,13 @@
5368

5469
## 0.12.7 [10.12.2023]
5570

71+
### Added:
72+
- 'Revert Prefab Name' option for prefabs in the GameObject/Prefabs context menu
73+
5674
### Changed:
5775
- Possibility to interact with ProgressBarDrawer (added IsInteractable property to the ProgressBarAttribute)
5876
- MinMaxAttribute now supports Vector2Int
5977

60-
### Added:
61-
- 'Revert Prefab Name' option for prefabs in the GameObject/Prefabs context menu
62-
6378
## 0.12.6 [19.10.2023]
6479

6580
### Changed:
@@ -68,12 +83,12 @@
6883

6984
## 0.12.5 [11.09.2023]
7085

71-
### Changed:
72-
- Make ToolboxEditorHandler public
73-
7486
### Added:
7587
- Add public OnCacheRefreshed event to the SceneSerializationUtility
7688

89+
### Changed:
90+
- Make ToolboxEditorHandler public
91+
7792
## 0.12.4 [31.07.2023]
7893

7994
### Changed:
@@ -85,16 +100,16 @@
85100

86101
## 0.12.3 [17.06.2023]
87102

103+
### Added:
104+
- SceneView extension: better way to select raycasted objects in the Scene view
105+
- LabelWidthAttribute
106+
88107
### Changed:
89108
- Fix updating SerializedScene index after deleting Scene
90109
- Fix SerializedScene index calculation
91110
- Fix NRE when deleted Scene was still included in Build Settings
92111
- Fix compilation errors in Unity 2018.x
93112

94-
### Added:
95-
- SceneView extension: better way to select raycasted objects in the Scene view
96-
- LabelWidthAttribute
97-
98113
## 0.12.1 [12.04.2023]
99114

100115
### Changed:

Assets/Editor Toolbox/Editor/ContextMenu.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
4+
namespace Toolbox.Editor.ContextMenu
5+
{
6+
internal interface IContextMenuOperation
7+
{
8+
bool IsVisible(SerializedProperty property);
9+
bool IsEnabled(SerializedProperty property);
10+
void Perform(SerializedProperty property);
11+
12+
GUIContent Label { get; }
13+
}
14+
}

Assets/Editor Toolbox/Editor/Utilities/AssemblyUtilities.cs.meta renamed to Assets/Editor Toolbox/Editor/ContextMenu/IContextMenuOperation.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor Toolbox/Editor/ContextMenu/Management.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System.Collections.Generic;
2+
3+
using UnityEditor;
4+
5+
namespace Toolbox.Editor.ContextMenu.Management
6+
{
7+
using Toolbox.Editor.ContextMenu.Operations;
8+
9+
[InitializeOnLoad]
10+
internal static class ToolboxContextMenuManager
11+
{
12+
private static readonly List<IContextMenuOperation> registeredOperations;
13+
14+
static ToolboxContextMenuManager()
15+
{
16+
registeredOperations = new List<IContextMenuOperation>()
17+
{
18+
new CopySerializeReferenceOperation(),
19+
new PasteSerializeReferenceOperation(),
20+
new DuplicateSerializeReferenceArrayElementOperation()
21+
};
22+
23+
EditorApplication.contextualPropertyMenu -= OnContextMenuOpening;
24+
EditorApplication.contextualPropertyMenu += OnContextMenuOpening;
25+
}
26+
27+
public static void AppendOpertation(IContextMenuOperation operation)
28+
{
29+
registeredOperations.Add(operation);
30+
}
31+
32+
public static bool RemoveOperation(IContextMenuOperation operation)
33+
{
34+
return registeredOperations.Remove(operation);
35+
}
36+
37+
private static void OnContextMenuOpening(GenericMenu menu, SerializedProperty property)
38+
{
39+
foreach (var operation in registeredOperations)
40+
{
41+
if (!operation.IsVisible(property))
42+
{
43+
continue;
44+
}
45+
46+
var label = operation.Label;
47+
if (!operation.IsEnabled(property))
48+
{
49+
menu.AddDisabledItem(label);
50+
continue;
51+
}
52+
53+
menu.AddItem(label, false, () =>
54+
{
55+
operation.Perform(property);
56+
});
57+
}
58+
}
59+
}
60+
}

Assets/Editor Toolbox/Editor/Internal/TypeConstraintReference.cs.meta renamed to Assets/Editor Toolbox/Editor/ContextMenu/Management/ToolboxContextMenuManager.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor Toolbox/Editor/ContextMenu/Operations.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor Toolbox/Editor/ContextMenu/Operations/SerializeReference.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
3+
namespace Toolbox.Editor.ContextMenu.Operations
4+
{
5+
internal class CopySerializeReferenceCache
6+
{
7+
public CopySerializeReferenceCache(Type referenceType, string data)
8+
{
9+
ReferenceType = referenceType;
10+
Data = data;
11+
}
12+
13+
public Type ReferenceType { get; }
14+
public string Data { get; }
15+
}
16+
}

0 commit comments

Comments
 (0)