DefaultValueAttribute Class

Summary

[Editor-Conditional] Specifies the default value of a field and a secondary fallback.
Assembly
Animancer.dll
Namespace
Animancer
Base Types
  • Attribute
Derived Types
graph BT Type-->Base0["Attribute"] Type["DefaultValueAttribute"] class Type type-node Derived0["DefaultFadeValueAttribute"]-->Type click Derived0 "/animancer/api/Animancer/DefaultFadeValueAttribute"

Syntax

[AttributeUsage(AttributeTargets.Field)]
[System.Diagnostics.Conditional(Strings.UnityEditor)]
public class DefaultValueAttribute : Attribute

Attributes

Type Description
AttributeUsageAttribute
ConditionalAttribute

Constructors

Name Summary
DefaultValueAttribute() Creates a new Animancer.DefaultValueAttribute.
DefaultValueAttribute(Object, Object) Creates a new Animancer.DefaultValueAttribute.

Properties

Name Value Summary
Primary Object
The main default value.
Secondary Object
The fallback value to use if the target value was already equal to the Animancer.DefaultValueAttribute.Primary.

Methods

Name Value Summary
SetToDefault<T>(T) void
[Editor-Only] Sets the `value` equal to the Animancer.DefaultValueAttribute.Primary value. If it was already at the value, it sets it equal to the Animancer.DefaultValueAttribute.Secondary value instead.
SetToDefault<T>(T, FieldInfo) void
[Editor-Only] If the field represented by the `property` has a Animancer.DefaultValueAttribute, this method sets the `value` to its Animancer.DefaultValueAttribute.Primary value. If it was already at the value, it sets it to the Animancer.DefaultValueAttribute.Secondary value instead. And if the field has no attribute, it uses the default for the type.
static
SetToDefault<T>(T, SerializedProperty) void
[Editor-Only] If the field represented by the `property` has a Animancer.DefaultValueAttribute, this method sets the `value` to its Animancer.DefaultValueAttribute.Primary value. If it was already at the value, it sets it to the Animancer.DefaultValueAttribute.Secondary value instead. And if the field has no attribute, it uses the default for the type.
static
SetToDefault<T>(T, T, T) void
[Editor-Only] Sets the `value` equal to the `primary` value. If it was already at the value, it sets it equal to the `secondary` value instead.
static