Skip to content

Commit

Permalink
Merge pull request #25 from techno-dwarf-works/feature/refactoring
Browse files Browse the repository at this point in the history
Version 0.0.22
  • Loading branch information
uurha committed Jul 20, 2024
1 parent ae24762 commit 34bf7e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions Editor/Drawers/SerializeReferenceField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,17 @@ private void Update()
}
finally
{
if (_bufferLabel != null)
{
_bufferLabel.RemoveFromHierarchy();
_bufferLabel = null;
}

if (TryCreateBufferLabel(property, out var label))
{
_bufferLabel = label;
Insert(0, _bufferLabel);
}
else
{
_bufferLabel?.RemoveFromHierarchy();
_bufferLabel = null;
}
}

using (var e = ReferenceTypeChangeEvent.GetPooled(_referenceType, newType))
Expand All @@ -135,7 +136,7 @@ private bool TryCreateBufferLabel(SerializedProperty property, out Label label)
var query = this.Query<SerializeReferenceField>().Last();
if (query == this)
{
if (property.managedReferenceFullTypename.IsNullOrEmpty())
if (property.managedReferenceFullTypename.IsNullOrEmpty() || !property.hasVisibleChildren)
{
label = VisualElementUtility.CreateLabel(PropertyField.label);
label.AddToClassList(StyleDefinition.CombineSubState(nameof(SerializeReferenceField), "dummy-label"));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.tdw.better.commons",
"displayName": "Better Commons",
"version": "0.0.21",
"version": "0.0.22",
"unity": "2021.3",
"description": " ",
"dependencies": {
Expand Down

0 comments on commit 34bf7e5

Please sign in to comment.