Class ChatMsgResponse
Handles incoming ChatEntry objects by displaying them as chat messages inside the configured chat-like message panel. Determines ownership of each message to present it with the appropriate owned or received style using the corresponding prefab.
[RequireComponent(typeof(TypewriterActor))]
public class ChatMsgResponse : MonoBehaviour, IEntryResponser<ChatEntry>, IEntryResponser
Inheritance
Implements
Methods
Awake()
Initializes the component by obtaining a reference to the owning TypewriterActor and setting up object pools for owned and received chat message presenters.
public void Awake()
HandleEntry(BaseEntry, ITypewriterContext)
Handles an incoming typewriter BaseEntry.
public void HandleEntry(BaseEntry entry, ITypewriterContext context)
Parameters
| Name | Type | Description |
|---|---|---|
entry | BaseEntry | The typewriter entry that this responder will process. |
context | ITypewriterContext | The context instance providing access to blackboards and runtime data shared with other entries in the same scope. |
HandleEntry(ChatEntry, ITypewriterContext)
Handles an incoming ChatEntry by determining whether the message belongs to this actor and displaying it with the correct style and format.
public void HandleEntry(ChatEntry entry, ITypewriterContext context)
Parameters
| Name | Type | Description |
|---|---|---|
entry | ChatEntry | The chat entry containing the message to be displayed. |
context | ITypewriterContext | The context instance providing access to blackboards and runtime data shared with other entries in the same scope. |