Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #126 from techno-dwarf-works/feature/refactoring
Browse files Browse the repository at this point in the history
Version 3.1.6
  • Loading branch information
uurha committed Jul 25, 2024
1 parent 9ff5931 commit 7bcba82
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ public override object GetCurrentValue()
{
var property = _container.SerializedProperty;
var objectOfProperty = property.GetValue();
var type = objectOfProperty.GetType();
Type type = null;
if (objectOfProperty == null)
{
type = GetFieldOrElementType();
return type;
}

type = objectOfProperty.GetType();
if (type == typeof(SerializedType))
{
type = (objectOfProperty as SerializedType)?.Type;
Expand Down
1 change: 0 additions & 1 deletion Editor/EditorAddons/Drawers/Select/SelectDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class SelectDrawer : BasePropertyDrawer<BaseSelectHandler, BaseSelectAttr
{
//TODO: Consider to use Locators
private Dictionary<SerializedProperty, BehavioredElement<Button>> _behavioredElements;
private Guid g = Guid.NewGuid();

public SelectDrawer()
{
Expand Down
3 changes: 0 additions & 3 deletions Samples~/TestSamples/Scripts/Models/SomeAbstractClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ namespace Samples.Models
[Serializable]
public abstract class SomeAbstractClass
{
[SerializeField] private protected int baseIntField;

public int BaseIntField => baseIntField;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@ namespace Samples.Models
public class SomeAbstractClassImplementation2 : SomeAbstractClass
{
[SerializeField] private bool boolField;

[SerializeField] private protected int baseIntField;

public int BaseIntField => baseIntField;
}

[Serializable]
public class SomeAbstractClassImplementation3 : SomeAbstractClass
{
}
}
16 changes: 16 additions & 0 deletions Samples~/TestSamples/Scripts/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,28 @@ public class TestInner
private int testIntLog;
}

[Serializable]
public class TestSerializableType : ITestSerializableType
{
[Select(typeof(ISomeInterface))]
[SerializeField]
private List<SerializedType> serializedTypes;
}

public interface ITestSerializableType
{
}

public class Test : MonoBehaviour
{
[HideLabel] [Select(typeof(ISomeInterface))]
[SerializeField]
private SerializedType serializedType;

[Select]
[SerializeReference]
private List<ITestSerializableType> serializedTypes;

[Select(typeof(ISomeInterface))]
[SerializeField]
private SerializedType serializedType2;
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "com.uurha.betterattributes",
"displayName": "Better Attributes",
"version": "3.1.5",
"version": "3.1.6",
"unity": "2021.3",
"description": "Unity attributes, allows to serialize interfaces, draw handles for Vector3/Vector2/Quaternion/Bounds, create read only fields.",
"dependencies": {
"com.tdw.better.commons" : "0.0.16",
"com.tdw.better.commons" : "0.0.26",
"com.tdw.better.internal.core" : "0.0.2"
},
"author": {
Expand Down

0 comments on commit 7bcba82

Please sign in to comment.