Skip to content

Commit 17c5c66

Browse files
committed
Merge branch 'develop' into feature/custom-contex-menu-controller
2 parents b2a36ba + 6075ff7 commit 17c5c66

294 files changed

Lines changed: 4876 additions & 1049 deletions

File tree

Some content is hidden

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

.github/workflows/upm-dev.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Update UPM branch (develop)
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
jobs:
7+
split-upm:
8+
name: split upm branch
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: split upm branch
15+
run: |
16+
git subtree split -P "$PKG_ROOT" -b upm-dev
17+
git push -u origin upm-dev
18+
env:
19+
PKG_ROOT: 'Assets/Editor Toolbox'

Assets/Editor Toolbox/CHANGELOG.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,116 @@
1+
## 0.12.13 [22.08.2024]
2+
3+
### Changed:
4+
- Hierarchy: Added Tree List renderer, which improves visual identification of parent and child gameobjects
5+
- Hierarchy: For now 'Script' label will display all available components linked to a GameObject/Prefabs
6+
- Hierarchy: For now 'Layer' label will display full layer name instead of the layer mask value
7+
- Fix SceneView settings change events firing when they shouldn't
8+
- Fix issue when trying to find private fields/properties from parent classes (e.g. while using conditional attributes)
9+
10+
### Added:
11+
- DisableInEditModeAttribute
12+
13+
## 0.12.12 [17.06.2024]
14+
15+
### Changed:
16+
- LabelWidthAttribute is now part of the Toolbox decorator attributes (can be mixed with other attributes)
17+
- Hierarchy: Script, Tag, and Layer columns are now excluded from the default settings
18+
- Possibility to change style for groups ([BeginGroup] and [BeginHorizontalGroup] attributes)
19+
- ScriptableObject Creation Wizard now accepts only ScriptableObjects marked with the [CreateInWizard] or [CreateAssetMenu] attributes
20+
21+
### Added:
22+
- NotPrefabObjectOnlyAttribute
23+
24+
## 0.12.11 [05.04.2024]
25+
26+
### Changed:
27+
- Fix handling the HasNativeTypeDrawer method in Unity 2022.3.23
28+
- Ignore `m_SerializedDataModeController` in Toolbox wizards
29+
- Change [Begin/EndHorizontal] behaviour (more customization options to handle available space)
30+
31+
## 0.12.10 [28.03.2024]
32+
33+
### Changed:
34+
- Fix fetching and initializing Toolbox features when assets are updating
35+
- Display ReorderableList element handle at the top of available space
36+
- Display "Collection is Empty" label for empty ReorderableLists
37+
- New visual appearance for the SerializedDictionary properties
38+
- Fix using Toolbox drawers in the SerializedDictionary properties
39+
- Change the default SceneView selector key to `Tab`
40+
41+
## 0.12.9 [27.01.2024]
42+
43+
### Changed:
44+
- Fix rare invalid SerializedProperty iterator when editing child properties
45+
- Extend objects creation behaviour while using the ReferencePickerAttribute (possibility to create uninitialized objects)
46+
- Minor UX improvements in the ScriptableObjectCreationWizard
47+
48+
## 0.12.8 [29.12.2023]
49+
50+
### Changed:
51+
- Fix calling the ScriptAttributeUtility.GetDrawerTypeForType method in Unity 2033.3+
52+
- Fix getting and setting scripting defines in Unity 2023+
53+
54+
## 0.12.7 [10.12.2023]
55+
56+
### Changed:
57+
- Possibility to interact with ProgressBarDrawer (added IsInteractable property to the ProgressBarAttribute)
58+
- MinMaxAttribute now supports Vector2Int
59+
60+
### Added:
61+
- 'Revert Prefab Name' option for prefabs in the GameObject/Prefabs context menu
62+
63+
## 0.12.6 [19.10.2023]
64+
65+
### Changed:
66+
- Fix ToolboxEditorToolbar in Unity 2021.1+
67+
- Minor API changes in the SearchablePopup class
68+
69+
## 0.12.5 [11.09.2023]
70+
71+
### Changed:
72+
- Make ToolboxEditorHandler public
73+
74+
### Added:
75+
- Add public OnCacheRefreshed event to the SceneSerializationUtility
76+
77+
## 0.12.4 [31.07.2023]
78+
79+
### Changed:
80+
- Fix SceneView selection tool behaviour when selecting nested prefabs
81+
- Fix InvalidOperationException when ExitGUIException is thrown inside PropertyScope
82+
- Minor SerializedScene index calculation performance improvements
83+
- Fix SearchablePopup styles initialization in Unity 2022+
84+
- Minor visual improvements on how ReferencePicker label is rendered
85+
86+
## 0.12.3 [17.06.2023]
87+
88+
### Changed:
89+
- Fix updating SerializedScene index after deleting Scene
90+
- Fix SerializedScene index calculation
91+
- Fix NRE when deleted Scene was still included in Build Settings
92+
- Fix compilation errors in Unity 2018.x
93+
94+
### Added:
95+
- SceneView extension: better way to select raycasted objects in the Scene view
96+
- LabelWidthAttribute
97+
98+
## 0.12.1 [12.04.2023]
99+
100+
### Changed:
101+
- Fix LabelByChild usage within lists
102+
- Possibility to foldout/in dictionaries
103+
104+
## 0.12.0 [10.12.2022]
105+
106+
### Changed:
107+
- UX improvements for the ScriptableObjectCreationWizard
108+
- New API for drawing custom Editors (check HOWTO.md for more details)
109+
- Fix label drawing while using the [ReferencePickerAttribute]
110+
- Fix searching for private methods in base classes while using the [EditorButtonAttribute]
111+
- Fix minor issues while using conditional drawers during multi-selection
112+
- Fix minor issues while using the [TitleAttribute] in groups
113+
1114
## 0.11.9 [22.10.2022]
2115

3116
### Added:

Assets/Editor Toolbox/Editor/Drawers/Helpers/DrawerDataStorage.cs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,31 @@ namespace Toolbox.Editor.Drawers
77
/// Internal system responsible for keeping and clearing data between <see cref="UnityEditor.Editor"/>s.
88
/// This small system works only for attribute-based drawers and should be defined as a static field.
99
/// </summary>
10-
/// <typeparam name="T">Key-related object.</typeparam>
11-
/// <typeparam name="T1">Data to store.</typeparam>
12-
/// <typeparam name="T2">Any type needed for storage item creation. Pass <see cref="EventArgs.Empty"/> if no additional data is needed.</typeparam>
13-
public abstract class DrawerDataStorage<T, T1, T2> : DrawerDataStorageBase
10+
/// <typeparam name="TKey">Key-related object.</typeparam>
11+
/// <typeparam name="TData">Data to store.</typeparam>
12+
/// <typeparam name="TArgs">Any type needed for storage item creation. Pass <see cref="EventArgs.Empty"/> if no additional data is needed.</typeparam>
13+
public abstract class DrawerDataStorage<TKey, TData, TArgs> : DrawerDataStorageBase
1414
{
15-
protected readonly Dictionary<string, T1> items = new Dictionary<string, T1>();
15+
protected readonly Dictionary<string, TData> items = new Dictionary<string, TData>();
1616

17-
protected readonly Func<T, T2, T1> createMethod;
18-
protected readonly Action<T1> removeMethod;
17+
protected readonly Func<TKey, TArgs, TData> createMethod;
18+
protected readonly Action<TData> removeMethod;
1919

20-
21-
public DrawerDataStorage(Func<T, T2, T1> createMethod) : this(createMethod, null)
20+
public DrawerDataStorage(Func<TKey, TArgs, TData> createMethod) : this(createMethod, null)
2221
{ }
2322

24-
public DrawerDataStorage(Func<T, T2, T1> createMethod, Action<T1> removeMethod)
23+
public DrawerDataStorage(Func<TKey, TArgs, TData> createMethod, Action<TData> removeMethod)
2524
{
2625
this.createMethod = createMethod;
2726
this.removeMethod = removeMethod;
2827
}
2928

30-
31-
protected abstract string GetKey(T context);
32-
29+
protected abstract string GetKey(TKey context);
3330

3431
/// <summary>
3532
/// Returns and if needed creates new item.
3633
/// </summary>
37-
public virtual T1 ReturnItem(T context, T2 args)
34+
public virtual TData ReturnItem(TKey context, TArgs args)
3835
{
3936
var key = GetKey(context);
4037
if (items.TryGetValue(key, out var item))
@@ -47,12 +44,12 @@ public virtual T1 ReturnItem(T context, T2 args)
4744
}
4845
}
4946

50-
public virtual T1 CreateItem(T context, T2 args)
47+
public virtual TData CreateItem(TKey context, TArgs args)
5148
{
5249
return CreateItem(context, args, true);
5350
}
5451

55-
public virtual T1 CreateItem(T context, T2 args, bool append)
52+
public virtual TData CreateItem(TKey context, TArgs args, bool append)
5653
{
5754
var item = createMethod(context, args);
5855
if (append)
@@ -63,13 +60,13 @@ public virtual T1 CreateItem(T context, T2 args, bool append)
6360
return item;
6461
}
6562

66-
public virtual T1 AppendItem(T context, T1 item)
63+
public virtual TData AppendItem(TKey context, TData item)
6764
{
6865
var key = GetKey(context);
6966
return items[key] = item;
7067
}
7168

72-
public virtual void ClearItem(T context)
69+
public virtual void ClearItem(TKey context)
7370
{
7471
var key = GetKey(context);
7572
if (removeMethod != null)

Assets/Editor Toolbox/Editor/Drawers/Helpers/DrawerDataStorageBase.cs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,17 @@
1-
using System.Collections.Generic;
2-
3-
namespace Toolbox.Editor.Drawers
1+
namespace Toolbox.Editor.Drawers
42
{
53
public abstract class DrawerDataStorageBase
64
{
7-
static DrawerDataStorageBase()
8-
{
9-
InspectorUtility.OnEditorReload += () =>
10-
{
11-
for (var i = 0; i < storages.Count; i++)
12-
{
13-
storages[i].ClearItems();
14-
}
15-
};
16-
}
17-
18-
195
protected DrawerDataStorageBase()
206
{
21-
storages.Add(this);
7+
DrawerStorageManager.AppendStorage(this);
228
}
239

2410
~DrawerDataStorageBase()
2511
{
26-
storages.Remove(this);
12+
DrawerStorageManager.RemoveStorage(this);
2713
}
2814

29-
30-
private static readonly List<DrawerDataStorageBase> storages = new List<DrawerDataStorageBase>();
31-
32-
3315
/// <summary>
3416
/// Called each time Editor is completely destroyed.
3517
/// </summary>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace Toolbox.Editor.Drawers
5+
{
6+
internal static class DrawerStorageManager
7+
{
8+
static DrawerStorageManager()
9+
{
10+
ToolboxEditorHandler.OnEditorReload -= ClearStorages;
11+
ToolboxEditorHandler.OnEditorReload += ClearStorages;
12+
}
13+
14+
private static readonly List<DrawerDataStorageBase> storages = new List<DrawerDataStorageBase>();
15+
16+
internal static void ClearStorages()
17+
{
18+
ClearStorages(null);
19+
}
20+
21+
internal static void ClearStorages(Func<DrawerDataStorageBase, bool> predicate)
22+
{
23+
for (var i = 0; i < storages.Count; i++)
24+
{
25+
var storage = storages[i];
26+
if (predicate != null && !predicate(storage))
27+
{
28+
continue;
29+
}
30+
31+
storage.ClearItems();
32+
}
33+
}
34+
35+
internal static void AppendStorage(DrawerDataStorageBase storage)
36+
{
37+
storages.Add(storage);
38+
}
39+
40+
internal static bool RemoveStorage(DrawerDataStorageBase storage)
41+
{
42+
return storages.Remove(storage);
43+
}
44+
}
45+
}

Assets/Editor Toolbox/Editor/Drawers/Regular/LabelByChildAttributeDrawer.cs.meta renamed to Assets/Editor Toolbox/Editor/Drawers/Helpers/DrawerStorageManager.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/Drawers/Helpers/Extraction/ValueExtractionHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public static class ValueExtractionHelper
1919
new MethodValueExtractor()
2020
};
2121

22-
2322
public static bool TryGetValue(string source, object declaringObject, out object value)
2423
{
2524
for (var i = 0; i < extractors.Count; i++)
@@ -73,7 +72,8 @@ public static bool TryGetValue(string source, SerializedProperty causer, out obj
7372
var parentObjects = new object[targetObjects.Length];
7473
for (var i = 0; i < targetObjects.Length; i++)
7574
{
76-
parentObjects[i] = causer.GetDeclaringObject(targetObjects[i]);
75+
var targetObject = targetObjects[i];
76+
parentObjects[i] = causer.GetDeclaringObject(targetObject);
7777
}
7878

7979
return TryGetValue(source, parentObjects, out value, out hasMixedValues, nextValuesComparer);

0 commit comments

Comments
 (0)