Class InputPromptView
Represents a single UI prompt for one interaction option on an interactable object. Displays the corresponding input (e.g., button or key), visualizes interaction progress with a fill bar, and updates its state based on player input and interaction status.
Works in coordination with InteractionView to ensure only the selected prompt remains active, while other InputPromptView instances are visually and functionally locked.
[RequireComponent(typeof(CanvasGroup))]
public class InputPromptView : MonoBehaviour
Inheritance
Methods
ActivateInputPromptTypeWriter()
Triggers a typewriter animation effect for the prompt text.
public void ActivateInputPromptTypeWriter()
PressDown()
Starts holding this prompt's button, as a key down or a hand touching the prompt does.
public void PressDown()
PressUp()
Stops holding this prompt's button, as a key up or a hand leaving the prompt does.
public void PressUp()
SetFillTarget(float)
Sets the target value for the fill bar.
public void SetFillTarget(float fillTarget)
Parameters
| Name | Type | Description |
|---|---|---|
fillTarget | float | Target fill value. |
SetInputPrompt(string, float)
Updates the interaction prompt text, optionally appending duration.
public void SetInputPrompt(string newText, float duration = 0)
Parameters
| Name | Type | Description |
|---|---|---|
newText | string | Prompt message. |
duration | float | Optional duration to show beside text. |
TweenFillBarToTargetValue(float, float)
Smoothly animates the fill bar to a target value.
public void TweenFillBarToTargetValue(float targetFill, float duration = 0)
Parameters
| Name | Type | Description |
|---|---|---|
targetFill | float | Target fill value. |
duration | float | Tween duration. |