Skip to content

Commit 18ac973

Browse files
authored
Merge pull request #148 from arimger/develop
Develop - 0.14.3
2 parents bc2a486 + f3f6ec7 commit 18ac973

24 files changed

+279
-74
lines changed

Assets/Editor Toolbox/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 0.14.3 [29.12.2025]
2+
3+
### Added:
4+
- Ability to specify 'ValueStep' in the ProgressBar attribute
5+
6+
### Changed:
7+
- Toolbar support for Unity 6.3+
8+
- Material Drawers support for Unity 6.3+
9+
- Serialized Scene support for Unity 6.3+
10+
- Fix issues with copy/past operations for the [SerializeReference]-based arrays
11+
- Ability to display parent objects in the SceneView tool
12+
- Ability to display managed reference values while using LabelByChild attribute
13+
114
## 0.14.2 [10.08.2025]
215

316
### Added:

Assets/Editor Toolbox/Editor/ContextMenu/Operations/SerializeReference/CopySerializeReferenceCache.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ namespace Toolbox.Editor.ContextMenu.Operations
99
/// </summary>
1010
internal class CopySerializeReferenceCache
1111
{
12-
public CopySerializeReferenceCache(Type referenceType, IReadOnlyList<CopySerializeReferenceEntry> entires)
12+
public CopySerializeReferenceCache(Type referenceType, IReadOnlyList<CopySerializeReferenceEntry> entires, bool isArrayCopy)
1313
{
1414
ReferenceType = referenceType;
1515
Entries = entires;
16+
IsArrayCopy = isArrayCopy;
1617
}
1718

1819
/// <summary>
1920
/// Base managed reference type of the source <see cref="UnityEditor.SerializedProperty"/>.
2021
/// </summary>
2122
public Type ReferenceType { get; }
2223
public IReadOnlyList<CopySerializeReferenceEntry> Entries { get; }
23-
public bool IsArrayCopy => Entries != null && Entries.Count > 1;
24+
public bool IsArrayCopy { get; }
2425
}
2526
}

Assets/Editor Toolbox/Editor/ContextMenu/Operations/SerializeReference/CopySerializeReferenceOperation.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public bool IsEnabled(SerializedProperty property)
5151

5252
public void Perform(SerializedProperty property)
5353
{
54+
var isArrayCopy = false;
5455
var entries = new List<CopySerializeReferenceEntry>();
5556
if (property.propertyType == SerializedPropertyType.ManagedReference)
5657
{
@@ -59,6 +60,7 @@ public void Perform(SerializedProperty property)
5960
}
6061
else if (property.isArray)
6162
{
63+
isArrayCopy = true;
6264
var propertiesCount = property.arraySize;
6365
for (var i = 0; i < propertiesCount; i++)
6466
{
@@ -69,7 +71,7 @@ public void Perform(SerializedProperty property)
6971
}
7072

7173
PropertyUtility.TryGetSerializeReferenceType(property, out var referenceType);
72-
Cache = new CopySerializeReferenceCache(referenceType, entries);
74+
Cache = new CopySerializeReferenceCache(referenceType, entries, isArrayCopy);
7375
}
7476

7577
public GUIContent Label => new GUIContent("Copy Serialized References");

Assets/Editor Toolbox/Editor/ContextMenu/Operations/SerializeReference/PasteSerializeReferenceOperation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private bool IsAssignmentValid(Type targetType, CopySerializeReferenceEntry entr
3636
return true;
3737
}
3838

39-
return TypeUtility.IsTypeAssignableFrom(targetType, entry.ReferenceType);
39+
return TypeUtility.IsTypeAssignableFrom(targetType, entryType);
4040
}
4141

4242
private bool IsOperationSupported(SerializedProperty targetProperty, CopySerializeReferenceCache cache)

Assets/Editor Toolbox/Editor/Drawers/Material/MaterialCompactTextureDrawer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ protected override void OnGUISafe(Rect position, MaterialProperty prop, string l
2727

2828
protected override bool IsPropertyValid(MaterialProperty prop)
2929
{
30+
#if UNITY_6000_3_OR_NEWER
31+
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Texture;
32+
#else
3033
return prop.type == MaterialProperty.PropType.Texture;
34+
#endif
3135
}
3236
}
3337
}

Assets/Editor Toolbox/Editor/Drawers/Material/MaterialConditionalDrawer.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ protected MaterialConditionalDrawer(string togglePropertyName)
1212
this.togglePropertyName = togglePropertyName;
1313
}
1414

15+
private bool IsValidToggleType(MaterialProperty toggleProp)
16+
{
17+
#if UNITY_6000_3_OR_NEWER
18+
return toggleProp.propertyType == UnityEngine.Rendering.ShaderPropertyType.Float ||
19+
toggleProp.propertyType == UnityEngine.Rendering.ShaderPropertyType.Range;
20+
#else
21+
return toggleProp.type == MaterialProperty.PropType.Float ||
22+
toggleProp.type == MaterialProperty.PropType.Range;
23+
#endif
24+
}
25+
1526
protected override float GetPropertyHeightSafe(MaterialProperty prop, string label, MaterialEditor editor)
1627
{
1728
if (!HasToggle(prop))
@@ -48,7 +59,7 @@ protected virtual bool HasToggle(MaterialProperty prop)
4859
{
4960
var targets = prop.targets;
5061
var toggle = MaterialEditor.GetMaterialProperty(targets, togglePropertyName);
51-
return toggle != null && toggle.type == MaterialProperty.PropType.Float || toggle.type == MaterialProperty.PropType.Range;
62+
return toggle != null && IsValidToggleType(toggle);
5263
}
5364

5465
protected virtual bool? GetValue(MaterialProperty prop)

Assets/Editor Toolbox/Editor/Drawers/Material/MaterialMinMaxSliderDrawer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ protected override void OnGUISafe(Rect position, MaterialProperty prop, string l
4444

4545
protected override bool IsPropertyValid(MaterialProperty prop)
4646
{
47+
#if UNITY_6000_3_OR_NEWER
48+
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Vector;
49+
#else
4750
return prop.type == MaterialProperty.PropType.Vector;
51+
#endif
4852
}
4953
}
5054
}

Assets/Editor Toolbox/Editor/Drawers/Material/MaterialVector2Drawer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ protected override void OnGUISafe(Rect position, MaterialProperty prop, string l
3030

3131
protected override bool IsPropertyValid(MaterialProperty prop)
3232
{
33+
#if UNITY_6000_3_OR_NEWER
34+
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Vector;
35+
#else
3336
return prop.type == MaterialProperty.PropType.Vector;
37+
#endif
3438
}
3539
}
3640
}

Assets/Editor Toolbox/Editor/Drawers/Material/MaterialVector3Drawer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ protected override void OnGUISafe(Rect position, MaterialProperty prop, string l
3030

3131
protected override bool IsPropertyValid(MaterialProperty prop)
3232
{
33+
#if UNITY_6000_3_OR_NEWER
34+
return prop.propertyType == UnityEngine.Rendering.ShaderPropertyType.Vector;
35+
#else
3336
return prop.type == MaterialProperty.PropType.Vector;
37+
#endif
3438
}
3539
}
3640
}

Assets/Editor Toolbox/Editor/Drawers/Regular/ProgressBarAttributeDrawer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,18 @@ private void SetProgressValue(SerializedProperty property, Rect progressBarRect,
4343
{
4444
var minValue = Attribute.MinValue;
4545
var maxValue = Attribute.MaxValue;
46+
var valueStep = Attribute.ValueStep;
4647

4748
var range = progressBarRect.xMax - progressBarRect.xMin;
4849
xPosition = Mathf.Clamp(xPosition - progressBarRect.xMin, 0, range);
4950

5051
var fill = Mathf.Clamp01(xPosition / range);
5152
var newValue = (maxValue - minValue) * fill + minValue;
53+
if (!Mathf.Approximately(valueStep, 0.0f))
54+
{
55+
newValue = Mathf.Round(newValue / valueStep) * valueStep;
56+
newValue = Mathf.Clamp(newValue, minValue, maxValue);
57+
}
5258

5359
switch (property.propertyType)
5460
{

0 commit comments

Comments
 (0)