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

NameType
triggerTextStudio.TextStudioReactionTrigger
unitIndexSystem.Int32
generationSystem.UInt32
nameSystem.String
intensitySystem.Single
sessionIdSystem.UInt32
sourceGenerationSystem.UInt32
transactionIdSystem.UInt64
changeKindTextStudio.TextStudioReactionChangeKind
eventTimeSystem.Double
wordStartSystem.Int32
wordEndSystem.Int32
lineStartSystem.Int32
lineEndSystem.Int32
selectedStartSystem.Int32
selectedEndSystem.Int32
targetBindingKeySystem.String
responseDurationSystem.Single
randomSeedSystem.UInt32