Skip to content

TextStudioReactionContext

StructTextStudioTextStudio
public readonly struct TextStudioReactionContext

Immutable event data. Unit indices refer to the source generation that emitted the event.

public readonly TextStudioReactionTrigger Trigger

Returns

TextStudio.TextStudioReactionTrigger

public readonly int UnitIndex

Returns

System.Int32

public readonly uint Generation

Returns

System.UInt32

public readonly uint SessionId

Returns

System.UInt32

public readonly uint SourceGeneration

Returns

System.UInt32

public readonly ulong TransactionId

Returns

System.UInt64

public readonly TextStudioReactionChangeKind ChangeKind

Returns

TextStudio.TextStudioReactionChangeKind

public readonly double EventTime

Returns

System.Double

public readonly int WordStart

Half-open semantic word and line spans, or -1 when unavailable.

Returns

System.Int32

public readonly int WordEnd

Half-open semantic word and line spans, or -1 when unavailable.

Returns

System.Int32

public readonly int LineStart

Half-open semantic word and line spans, or -1 when unavailable.

Returns

System.Int32

public readonly int LineEnd

Half-open semantic word and line spans, or -1 when unavailable.

Returns

System.Int32

public readonly int SelectedStart

Half-open selected span, or -1/-1 for All or no selected scope.

Returns

System.Int32

public readonly int SelectedEnd

Half-open selected span, or -1/-1 for All or no selected scope.

Returns

System.Int32

public readonly string Name

Returns

System.String

public readonly string TargetBindingKey

Returns

System.String

public readonly float Intensity

Returns

System.Single

public readonly float ResponseDuration

Returns

System.Single

public readonly uint RandomSeed

Stable per-response variation seed; independent of Unity random and runtime session IDs.

Returns

System.UInt32

TextStudioReactionContext(TextStudioReactionTrigger, int, uint, string, float, uint, uint, ulong, TextStudioReactionChangeKind, double, int, int, int, int, int, int, string, float, uint)

Section titled “TextStudioReactionContext(TextStudioReactionTrigger, int, uint, string, float, uint, uint, ulong, TextStudioReactionChangeKind, double, int, int, int, int, int, int, string, float, uint)”
public TextStudioReactionContext(TextStudioReactionTrigger trigger, int unitIndex = -1, uint generation = 0, string name = null, float intensity = 1, uint sessionId = 0, uint sourceGeneration = 0, ulong transactionId = 0, TextStudioReactionChangeKind changeKind = TextStudioReactionChangeKind.None, double eventTime = 0, int wordStart = -1, int wordEnd = -1, int lineStart = -1, int lineEnd = -1, int selectedStart = -1, int selectedEnd = -1, string targetBindingKey = null, float responseDuration = 0, uint randomSeed = 0)

Creates an immutable reaction event context containing text identity, semantic ranges, timing, targeting, intensity, and random seed.

Parameters

Name Type
trigger TextStudio.TextStudioReactionTrigger
unitIndex System.Int32
generation System.UInt32
name System.String
intensity System.Single
sessionId System.UInt32
sourceGeneration System.UInt32
transactionId System.UInt64
changeKind TextStudio.TextStudioReactionChangeKind
eventTime System.Double
wordStart System.Int32
wordEnd System.Int32
lineStart System.Int32
lineEnd System.Int32
selectedStart System.Int32
selectedEnd System.Int32
targetBindingKey System.String
responseDuration System.Single
randomSeed System.UInt32