Class InteractionView
Provides the visual representation of available interaction options to the user. Responsible for showing prompts, updating progress visuals, and managing UI lock states.
public class InteractionView : MonoBehaviour
Inheritance
Properties
IsVisible
Whether the interaction UI is currently displayed.
public bool IsVisible { get; }
Property Value
bool
OptionCapacity
Number of option slots this view can display at once.
public int OptionCapacity { get; }
Property Value
int
Methods
FocusOption(int)
Locks all interaction options except the one specified by index.
public void FocusOption(int index)
Parameters
| Name | Type | Description |
|---|---|---|
index | int | Index of the option to remain unlocked and focused. |
LockOption(int)
Locks a specific interaction option UI element.
public void LockOption(int index)
Parameters
| Name | Type | Description |
|---|---|---|
index | int | Index of the option to lock. |
ReleaseAllLocks()
Releases all locks from every interaction option UI element.
public void ReleaseAllLocks()
ReleaseLock(int)
Releases the lock on a specific interaction option UI element.
public void ReleaseLock(int index)
Parameters
| Name | Type | Description |
|---|---|---|
index | int | Index of the option to unlock. |
Show(IReadOnlyList<InteractionOptionDisplay>)
Shows the interaction UI and populates each prompt slot from the supplied display data.
public void Show(IReadOnlyList<InteractionOptionDisplay> options)
Parameters
| Name | Type | Description |
|---|---|---|
options | IReadOnlyList<InteractionOptionDisplay> | Display data for each option, in slot order. Slots beyond the supplied count are hidden. |
Remarks
The view deliberately takes presentation data rather than an Interactable so it stays independent of the interaction domain model.
UpdateFill(int, float)
Updates the fill amount (e.g., progress bar) for the specified interaction option UI element.
public void UpdateFill(int index, float fillAmount)
Parameters
| Name | Type | Description |
|---|---|---|
index | int | Index of the interaction option to update. |
fillAmount | float | Fill amount value between 0 and 1. |
OptionHeld
Raised each frame while the player holds an option prompt. The argument is the option's slot index.
public event Action<int> OptionHeld
Event Type
Action<int>