Compare commits

...

3 Commits

Author SHA1 Message Date
max
310c45cb98 Update package 2022-05-07 01:39:35 +02:00
max
087a0f7fdb Update ExtendedScriptableObjectDrawer.cs 2022-05-07 01:33:01 +02:00
max
f00c7d43aa NonSerialized fields
Fixed private fields in ScriptableObject getting serialized.
2022-01-02 17:11:40 +01:00
4 changed files with 19 additions and 14 deletions

View File

@ -1,4 +1,8 @@
# Change Log:
## 1.1.3
- Update ExtendedScriptableObjectDrawer.
## 1.1.2
- Fixed private fields in ScriptableObject getting serialized.
## 1.1.1
- Instance indicator colors.
- Code refactor.

View File

@ -16,7 +16,8 @@ namespace ScriptableData.Editor
{
// Permamently exclude classes from being affected by the drawer.
private static readonly string[] ignoredFullClassNames = new string[] { "TMPro.TMP_FontAsset" };
private const int buttonWidth = 20;
private static readonly GUIContent buttonContent = EditorGUIUtility.IconContent("d_ScriptableObject On Icon");
private const int buttonWidth = 16;
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
@ -106,7 +107,7 @@ namespace ScriptableData.Editor
propertyRect.width -= buttonWidth;
// Draw create button.
Rect buttonRect = new Rect(position.x + position.width - buttonWidth, position.y, buttonWidth, EditorGUIUtility.singleLineHeight);
Rect buttonRect = new Rect(position.x + position.width - buttonWidth, position.y + 1, buttonWidth, EditorGUIUtility.singleLineHeight);
DrawScriptableObjectCreateButton(buttonRect, property, fieldType);
}
}
@ -126,7 +127,7 @@ namespace ScriptableData.Editor
private static void DrawScriptableObjectCreateButton(Rect position, SerializedProperty property, Type type)
{
if (GUI.Button(position, "+"))
if (GUI.Button(position, buttonContent, EditorStyles.iconButton))
{
GenericMenu typeChooser = new GenericMenu();
IEnumerable<Type> types = type.Assembly.GetTypes().Where(t => type.IsAssignableFrom(t));

View File

@ -7,7 +7,7 @@ namespace ScriptableData
{
public event Action<T0> OnValueChangedEvent;
private T0 _value;
[NonSerialized] private T0 _value;
public T0 Value
{
get
@ -37,7 +37,7 @@ namespace ScriptableData
{
public event Action<T0, T1> OnValueChangedEvent;
private T0 _value;
[NonSerialized] private T0 _value;
public T0 Value
{
get
@ -51,7 +51,7 @@ namespace ScriptableData
}
}
private T1 _value1;
[NonSerialized] private T1 _value1;
public T1 Value1
{
get
@ -88,7 +88,7 @@ namespace ScriptableData
{
public event Action<T0, T1, T2> OnValueChangedEvent;
private T0 _value;
[NonSerialized] private T0 _value;
public T0 Value
{
get
@ -102,7 +102,7 @@ namespace ScriptableData
}
}
private T1 _value1;
[NonSerialized] private T1 _value1;
public T1 Value1
{
get
@ -116,7 +116,7 @@ namespace ScriptableData
}
}
private T2 _value2;
[NonSerialized] private T2 _value2;
public T2 Value2
{
get
@ -161,7 +161,7 @@ namespace ScriptableData
{
public event Action<T0, T1, T2, T3> OnValueChangedEvent;
private T0 _value;
[NonSerialized] private T0 _value;
public T0 Value
{
get
@ -175,7 +175,7 @@ namespace ScriptableData
}
}
private T1 _value1;
[NonSerialized] private T1 _value1;
public T1 Value1
{
get
@ -189,7 +189,7 @@ namespace ScriptableData
}
}
private T2 _value2;
[NonSerialized] private T2 _value2;
public T2 Value2
{
get
@ -203,7 +203,7 @@ namespace ScriptableData
}
}
private T3 _value3;
[NonSerialized] private T3 _value3;
public T3 Value3
{
get

View File

@ -1,7 +1,7 @@
{
"name": "com.vertexcolor.scriptabledata",
"displayName": "ScriptableData",
"version": "1.1.1",
"version": "1.1.3",
"unity": "2019.1",
"description": "ScriptableData code base for ScriptableObject workflow.",
"category": "Tool",