Class SuperSerializedProperty
- Namespace
- LoM.Super.Serialization
- Assembly
- LoM.Super.Editor.dll
SuperSerializedProperty and SuperSerializedObject are classes for editing properties on
objects in a completely generic way that automatically handles undo, multi-object
editing and Prefab overrides.
Unlike the SerializedObject and SerializedProperty classes provided by Unity,
this class supports Properties and Fields
public class SuperSerializedProperty
- Inheritance
-
SuperSerializedProperty
Properties
Attributes
public SerializedAttributes Attributes { get; }
Property Value
Field
public SerializedProperty Field { get; }
Property Value
Info
public MemberInfo Info { get; }
Property Value
IsField
public bool IsField { get; }
Property Value
TargetObject
Target object of this property (Read Only).
public Object TargetObject { get; }
Property Value
Type
Type of the property. (Read Only)
public Type Type { get; }
Property Value
animationCurveValue
Value of a animation curve property.
public AnimationCurve animationCurveValue { get; set; }
Property Value
animationCurveValueSingle
Value of a animation curve property (Single)
Returns the item's single value (not the multi-editing value).
public AnimationCurve animationCurveValueSingle { get; }
Property Value
arrayElementType
Type name of the element in an array property. (Read Only)
public string arrayElementType { get; }
Property Value
arraySize
The number of elements in the array.
public int arraySize { get; set; }
Property Value
boolValue
Value of a boolean property.
public bool boolValue { get; set; }
Property Value
boolValueSingle
public bool boolValueSingle { get; }
Property Value
boundsIntValue
Value of bounds with integer values property.
public BoundsInt boundsIntValue { get; set; }
Property Value
boundsIntValueSingle
Value of bounds with integer values property (Single)
Returns the item's single value (not the multi-editing value).
public BoundsInt boundsIntValueSingle { get; }
Property Value
boundsValue
Value of bounds property.
public Bounds boundsValue { get; set; }
Property Value
boundsValueSingle
Value of bounds property (Single)
Returns the item's single value (not the multi-editing value).
public Bounds boundsValueSingle { get; }
Property Value
boxedValue
Value of the SerializedProperty, boxed as a System.Object.
public object boxedValue { get; set; }
Property Value
boxedValueSingle
Value of the SerializedProperty, boxed as a System.Object (Single)
Returns the item's single value (not the multi-editing value).
public object boxedValueSingle { get; }
Property Value
colorValue
Value of a color property.
public Color colorValue { get; set; }
Property Value
colorValueSingle
Value of a color property (Single)
Returns the item's single value (not the multi-editing value).
public Color colorValueSingle { get; }
Property Value
contentHash
Provides the hash value for the property. (Read Only)
public uint contentHash { get; }
Property Value
depth
Nesting depth of the property. (Read Only)
public int depth { get; }
Property Value
displayName
Nice display name of the property. (Read Only)
public string displayName { get; }
Property Value
doubleValue
Value of a float property as a double.
public double doubleValue { get; set; }
Property Value
doubleValueSingle
Value of a float property as a double (Single)
Returns the item's single value (not the multi-editing value).
public double doubleValueSingle { get; }
Property Value
editable
Is this property editable? (Read Only)
public bool editable { get; }
Property Value
enumDisplayNames
Display-friendly names of enumeration of an enum property.
public string[] enumDisplayNames { get; }
Property Value
- string[]
enumDisplayNamesSingle
Display-friendly names of enumeration of an enum property (Single)
Returns the item's single value (not the multi-editing value).
public string[] enumDisplayNamesSingle { get; }
Property Value
- string[]
enumNames
Names of enumeration of an enum property.
public string[] enumNames { get; }
Property Value
- string[]
enumNamesSingle
Names of enumeration of an enum property (Single)
Returns the item's single value (not the multi-editing value).
public string[] enumNamesSingle { get; }
Property Value
- string[]
enumValueFlag
Int32 representation of an enum property with Mixed Values.
public int enumValueFlag { get; set; }
Property Value
enumValueFlagSingle
Int32 representation of an enum property with Mixed Values (Single)
Returns the item's single value (not the multi-editing value).
public int enumValueFlagSingle { get; }
Property Value
enumValueIndex
Enum index of an enum property.
public int enumValueIndex { get; set; }
Property Value
enumValueIndexSingle
Enum index of an enum property (Single)
Returns the item's single value (not the multi-editing value).
public int enumValueIndexSingle { get; }
Property Value
exposedReferenceValue
A reference to another Object in the Scene. This reference is resolved in the context of the SerializedObject containing the SerializedProperty.
public Object exposedReferenceValue { get; set; }
Property Value
exposedReferenceValueSingle
A reference to another Object in the Scene. This reference is resolved in the
context of the SerializedObject containing the SerializedProperty (Single)
Returns the item's single value (not the multi-editing value).
public Object exposedReferenceValueSingle { get; }
Property Value
fixedBufferSize
The number of elements in the fixed buffer. (Read Only)
public int fixedBufferSize { get; }
Property Value
floatValue
Value of a float property.
public float floatValue { get; set; }
Property Value
floatValueSingle
Value of a float property (Single)
Returns the item's single value (not the multi-editing value).
public float floatValueSingle { get; }
Property Value
gradientValue
Value of a gradient property.
public Gradient gradientValue { get; set; }
Property Value
- Gradient
gradientValueSingle
Value of a gradient property (Single)
Returns the item's single value (not the multi-editing value).
public Gradient gradientValueSingle { get; }
Property Value
- Gradient
hasChildren
Does it have child properties? (Read Only)
public bool hasChildren { get; }
Property Value
hasMultipleDifferentValues
Does this property represent multiple different values due to multi-object editing? (Read Only)
public bool hasMultipleDifferentValues { get; }
Property Value
hasVisibleChildren
Does it have visible child properties? (Read Only)
public bool hasVisibleChildren { get; }
Property Value
hash128Value
The value of a Hash128 property.
public Hash128 hash128Value { get; set; }
Property Value
- Hash128
hash128ValueSingle
The value of a Hash128 property (Single)
Returns the item's single value (not the multi-editing value).
public Hash128 hash128ValueSingle { get; }
Property Value
- Hash128
intValue
Value of an integer property.
public int intValue { get; set; }
Property Value
intValueSingle
Value of an integer property (Single)
Returns the item's single value (not the multi-editing value).
public int intValueSingle { get; }
Property Value
isAnimated
Is this property animated? (Read Only)
public bool isAnimated { get; }
Property Value
isArray
Is this property an array? (Read Only)
public bool isArray { get; }
Property Value
isDefaultOverride
Allows you to check whether his property is a PrefabUtility.IsDefaultOverride|default override. Certain properties on Prefab instances are default overrides. See PrefabUtility.IsDefaultOverride for more information.
public bool isDefaultOverride { get; }
Property Value
isExpanded
Is this property expanded in the inspector?
public bool isExpanded { get; set; }
Property Value
isFixedBuffer
Is this property a fixed buffer? (Read Only)
public bool isFixedBuffer { get; }
Property Value
isInstantiatedPrefab
Is property part of a Prefab instance? (Read Only)
public bool isInstantiatedPrefab { get; }
Property Value
longValue
Value of an integer property as a long.
public long longValue { get; set; }
Property Value
longValueSingle
Value of an integer property as a long (Single)
Returns the item's single value (not the multi-editing value).
public long longValueSingle { get; }
Property Value
managedReferenceFieldTypename
String corresponding to the value of the managed reference field full type string.
public string managedReferenceFieldTypename { get; }
Property Value
managedReferenceFieldTypenameSingle
String corresponding to the value of the managed reference field full type string (Single)
Returns the item's single value (not the multi-editing value).
public string managedReferenceFieldTypenameSingle { get; }
Property Value
managedReferenceFullTypename
String corresponding to the value of the managed reference object (dynamic) full type string.
public string managedReferenceFullTypename { get; }
Property Value
managedReferenceFullTypenameSingle
String corresponding to the value of the managed reference object (dynamic) full
type string (Single)
Returns the item's single value (not the multi-editing value).
public string managedReferenceFullTypenameSingle { get; }
Property Value
managedReferenceId
Id associated with a managed reference.
public long managedReferenceId { get; set; }
Property Value
managedReferenceIdSingle
Id associated with a managed reference (Single)
Returns the item's single value (not the multi-editing value).
public long managedReferenceIdSingle { get; }
Property Value
managedReferenceValue
The object assigned to a field with SerializeReference attribute.
public object managedReferenceValue { get; set; }
Property Value
managedReferenceValueSingle
The object assigned to a field with SerializeReference attribute (Single)
Returns the item's single value (not the multi-editing value).
public object managedReferenceValueSingle { get; }
Property Value
minArraySize
The smallest number of elements in the array across all target objects. (Read Only)
public int minArraySize { get; }
Property Value
name
Name of the property. (Read Only)
public string name { get; }
Property Value
numericType
Return the precise type for Integer and Floating point properties. (Read Only)
public SerializedPropertyNumericType numericType { get; }
Property Value
objectReferenceInstanceIDValue
Object ID of an object reference property.
public int objectReferenceInstanceIDValue { get; set; }
Property Value
objectReferenceInstanceIDValueSingle
Object ID of an object reference property (Single)
Returns the item's single value (not the multi-editing value).
public int objectReferenceInstanceIDValueSingle { get; }
Property Value
objectReferenceValue
Value of an object reference property.
public Object objectReferenceValue { get; set; }
Property Value
objectReferenceValueSingle
Value of an object reference property (Single)
Returns the item's single value (not the multi-editing value).
public Object objectReferenceValueSingle { get; }
Property Value
prefabOverride
Allows you to check whether a property's value is overriden (i.e. different to the Prefab it belongs to).
public bool prefabOverride { get; set; }
Property Value
propertyPath
Full path of the property. (Read Only)
public string propertyPath { get; }
Property Value
propertyType
Type of this property (Read Only).
public SerializedPropertyType propertyType { get; }
Property Value
quaternionValue
Value of a quaternion property.
public Quaternion quaternionValue { get; set; }
Property Value
quaternionValueSingle
Value of a quaternion property (Single)
Returns the item's single value (not the multi-editing value).
public Quaternion quaternionValueSingle { get; }
Property Value
rectIntValue
Value of a rectangle with integer values property.
public RectInt rectIntValue { get; set; }
Property Value
rectIntValueSingle
Value of a rectangle with integer values property (Single)
Returns the item's single value (not the multi-editing value).
public RectInt rectIntValueSingle { get; }
Property Value
rectValue
Value of a rectangle property.
public Rect rectValue { get; set; }
Property Value
rectValueSingle
Value of a rectangle property (Single)
Returns the item's single value (not the multi-editing value).
public Rect rectValueSingle { get; }
Property Value
serializedObject
SerializedObject this property belongs to (Read Only).
public SerializedObject serializedObject { get; }
Property Value
stringValue
Value of a string property.
public string stringValue { get; set; }
Property Value
stringValueSingle
Value of a string property (Single)
Returns the item's single value (not the multi-editing value).
public string stringValueSingle { get; }
Property Value
superSerializedObject
SerializedObject this property belongs to (Read Only).
public SuperSerializedObject superSerializedObject { get; }
Property Value
tooltip
Tooltip of the property. (Read Only)
public string tooltip { get; }
Property Value
type
Type name of the property. (Read Only)
public string type { get; }
Property Value
uintValue
Value of an integer property as an unsigned int.
public uint uintValue { get; set; }
Property Value
uintValueSingle
Value of an integer property as an unsigned int (Single)
Returns the item's single value (not the multi-editing value).
public uint uintValueSingle { get; }
Property Value
ulongValue
Value of an integer property as an unsigned long.
public ulong ulongValue { get; set; }
Property Value
ulongValueSingle
Value of an integer property as an unsigned long (Single)
Returns the item's single value (not the multi-editing value).
public ulong ulongValueSingle { get; }
Property Value
vector2IntValue
Value of a 2D integer vector property.
public Vector2Int vector2IntValue { get; set; }
Property Value
vector2IntValueSingle
Value of a 2D integer vector property (Single)
Returns the item's single value (not the multi-editing value).
public Vector2Int vector2IntValueSingle { get; }
Property Value
vector2Value
Value of a 2D vector property.
public Vector2 vector2Value { get; set; }
Property Value
vector2ValueSingle
Value of a 2D vector property (Single)
Returns the item's single value (not the multi-editing value).
public Vector2 vector2ValueSingle { get; }
Property Value
vector3IntValue
Value of a 3D integer vector property.
public Vector3Int vector3IntValue { get; set; }
Property Value
- Vector3Int
vector3IntValueSingle
Value of a 3D integer vector property (Single)
Returns the item's single value (not the multi-editing value).
public Vector3Int vector3IntValueSingle { get; }
Property Value
- Vector3Int
vector3Value
Value of a 3D vector property.
public Vector3 vector3Value { get; set; }
Property Value
- Vector3
vector3ValueSingle
Value of a 3D vector property (Single)
Returns the item's single value (not the multi-editing value).
public Vector3 vector3ValueSingle { get; }
Property Value
- Vector3
vector4Value
Value of a 4D vector property.
public Vector4 vector4Value { get; set; }
Property Value
- Vector4
vector4ValueSingle
Value of a 4D vector property (Single)
Returns the item's single value (not the multi-editing value).
public Vector4 vector4ValueSingle { get; }
Property Value
- Vector4
Methods
ClearArray()
Remove all elements from the array.
public void ClearArray()
Copy()
[Obsolete("Use SuperSerializedProperty.CopyPropery() instead.")]
public SerializedProperty Copy()
Returns
CopyPropery()
Returns a copy of the SerializedProperty iterator in its current state.
public SuperSerializedProperty CopyPropery()
Returns
CountInProperty()
Count visible children of this property, including this property itself.
public int CountInProperty()
Returns
CountRemaining()
Count remaining visible properties.
public int CountRemaining()
Returns
DataEquals(SerializedProperty, SerializedProperty)
Compares the data for two SerializedProperties. This method ignores paths and SerializedObjects.
public static bool DataEquals(SerializedProperty x, SerializedProperty y)
Parameters
Returns
DeleteArrayElementAtIndex(int)
Delete the element at the specified index in the array.
public void DeleteArrayElementAtIndex(int index)
Parameters
index
int
DeleteCommand()
Deletes the array element referenced by the SerializedProperty.
public bool DeleteCommand()
Returns
Dispose()
public void Dispose()
DuplicateCommand()
Duplicates the array element referenced by the SerializedProperty.
public bool DuplicateCommand()
Returns
EqualContents(SerializedProperty, SerializedProperty)
See if contained serialized properties are equal.
public static bool EqualContents(SerializedProperty x, SerializedProperty y)
Parameters
Returns
FindPropertyRelative(string)
Retrieves the SerializedProperty at a relative path to the current property.
public SerializedProperty FindPropertyRelative(string relativePropertyPath)
Parameters
relativePropertyPath
string
Returns
GetArrayElementAtIndex(int)
Returns the element at the specified index in the array.
public SerializedProperty GetArrayElementAtIndex(int index)
Parameters
index
int
Returns
GetEndProperty()
Retrieves the SerializedProperty that defines the end range of this property.
public SerializedProperty GetEndProperty()
Returns
GetEndProperty(bool)
Retrieves the SerializedProperty that defines the end range of this property.
public SerializedProperty GetEndProperty(bool includeInvisible)
Parameters
includeInvisible
bool
Returns
GetEnumerator()
Retrieves an iterator for enumerating over the visible child properties of the current property. If the property is an array it will enumerate over the array elements.
public IEnumerator GetEnumerator()
Returns
GetFixedBufferElementAtIndex(int)
Returns the element at the specified index in the fixed buffer.
public SerializedProperty GetFixedBufferElementAtIndex(int index)
Parameters
index
int
Returns
InsertArrayElementAtIndex(int)
Insert an new element at the specified index in the array.
public void InsertArrayElementAtIndex(int index)
Parameters
index
int
InvokeMethod(string)
Invoke a method on the target object / objects.
public void InvokeMethod(string methodName)
Parameters
methodName
stringName of the method to be invoked
InvokeMethod(string, Object)
Invoke a method on a specific target object.
public void InvokeMethod(string methodName, Object obj)
Parameters
InvokeMethod<T>(string, params object[])
Invoke a method on the target object / objects with parameters.
public T InvokeMethod<T>(string methodName, params object[] parameters)
Parameters
methodName
stringName of the method to be invoked
parameters
object[]Parameters to be passed to the method
Returns
- T
Return value of the method
Type Parameters
T
Type of the parameter
InvokeMethod<T>(string, Object, params object[])
Invoke a method on a specific target object with parameters.
public T InvokeMethod<T>(string methodName, Object obj, params object[] parameters)
Parameters
methodName
stringName of the method to be invoked
obj
ObjectTarget object
parameters
object[]Parameters to be passed to the method
Returns
- T
Return value of the method
Type Parameters
T
Type of the parameter
MoveArrayElement(int, int)
Move an array element from srcIndex to dstIndex.
public bool MoveArrayElement(int srcIndex, int dstIndex)
Parameters
Returns
Next(bool)
Move to next property.
public bool Next(bool enterChildren)
Parameters
enterChildren
bool
Returns
NextVisible(bool)
Move to next visible property.
public bool NextVisible(bool enterChildren)
Parameters
enterChildren
bool
Returns
Reevaluate()
Trigger re-evaluation of all condition attributes on this property.
public void Reevaluate()
Reset()
Move to first property of the object.
public void Reset()
Operators
implicit operator SerializedProperty(SuperSerializedProperty)
public static implicit operator SerializedProperty(SuperSerializedProperty superSerializedProperty)
Parameters
superSerializedProperty
SuperSerializedProperty