Skip to content

GenerateValueCallbackAttribute Class

Mark a field or property to generate a value change callback. The target must derive from ScriptableValue<T>.

C#
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
public sealed class GenerateValueCallbackAttribute : Attribute

Inheritance objectAttribute

The containing type must be marked with GenerateScriptableCallbacksAttribute in order to generate any callbacks.

Constructs a new GenerateValueCallbackAttribute with the default Changed.

C#
public GenerateValueCallbackAttribute()

GenerateValueCallbackAttribute(ValueCallbackType)

Section titled “GenerateValueCallbackAttribute(ValueCallbackType)”

Constructs a new GenerateValueCallbackAttribute with the specified ValueCallbackType.

C#
public GenerateValueCallbackAttribute(ValueCallbackType type)

type ValueCallbackType
Sets how the callback will be generated.

Can be used to set a custom name for the generated callback method. If not set, the default naming convention will be used.

C#
public string CallbackName { get; set; }