Table of Contents

Class TransientAttribute

Namespace
Trailblazer.Support
Assembly
Trailblazer.dll

Marks a property as transient, indicating that it holds frame-local state that can be synchronized from another instance or cleared back to defaults.

[AttributeUsage(AttributeTargets.Property)]
public class TransientAttribute : Attribute
Inheritance
TransientAttribute
Inherited Members

Remarks

When a default value source and member are provided via the two-argument constructor, ClearTransientState() resets the property to that static member's value instead of default(T). Useful for types whose zero-value is not a valid reset state (e.g. identity matrices or quaternions).

Constructors

TransientAttribute()

Marks the property as transient and clears it to default(T) on reset.

public TransientAttribute()

TransientAttribute(Type, string)

Marks the property as transient and clears it to a specific static member value on reset.

public TransientAttribute(Type defaultValueSource, string defaultValueMember)

Parameters

defaultValueSource Type

The type declaring the static default member.

defaultValueMember string

The name of the static field or property to read.

Properties

DefaultValueMember

Gets the name of the static field or property on DefaultValueSource to use as the clear default, or null to use default(T).

public string? DefaultValueMember { get; }

Property Value

string

DefaultValueSource

Gets the type that declares the static member to use as the clear default, or null to use default(T).

public Type? DefaultValueSource { get; }

Property Value

Type