Class TypewriterContext
Implements ITypewriterContext with a three-tier blackboard hierarchy: global (across all scenes), scene-scoped (cleared on scene unload), and object-local (per-instance variables).
public class TypewriterContext : ITypewriterContext
Inheritance
Remarks
The three tiers map to the simulation's scoping needs: the global blackboard persists participant state across scenario scenes (e.g., cumulative trust score), the scene blackboard holds scenario-specific flags that should reset between runs, and the object blackboard holds per-character state such as whether a pedestrian has already greeted the player in this session.
Scene blackboards are cleared via sceneUnloaded rather than on scene load so that any dialogue still resolving during the unload frame can access its variables before they disappear.
Methods
TryGetBlackboard(int, out IBlackboard)
Attempts to retrieve an IBlackboard instance corresponding to the given scope ID. If the blackboard doesn't yet exist for the scope, it will be created automatically. Returns true if a blackboard could be resolved; otherwise false.
public bool TryGetBlackboard(int scope, out IBlackboard blackboard)
Parameters
| Name | Type | Description |
|---|---|---|
scope | int | The unique integer ID of the scope entry. |
blackboard | IBlackboard | The resolved blackboard if found or created. |
Returns
bool — True if the scope was valid and blackboard was returned; otherwise false.