Class WeaverArrowPrompt
Used to display an arrow prompt with text above an object. Mainly used by WeaverBench and WeaverNPC
Namespace: WeaverCore.Assets.Components
Assembly: WeaverCore.dll
Syntax
public class WeaverArrowPrompt : MonoBehaviour
Fields
| Edit this page View SourceDestroyOnHide
Declaration
[Tooltip("Should the prompt automatically be destroyed when it fades out?")]
public bool DestroyOnHide
Field Value
Type | Description |
---|---|
bool |
Properties
| Edit this page View SourceAnimator
Declaration
public WeaverAnimationPlayer Animator { get; }
Property Value
Type | Description |
---|---|
WeaverAnimationPlayer |
DefaultPrefab
Declaration
public static WeaverArrowPrompt DefaultPrefab { get; }
Property Value
Type | Description |
---|---|
WeaverArrowPrompt |
IsVisible
Is the prompt currently visible?
Declaration
public bool IsVisible { get; }
Property Value
Type | Description |
---|---|
bool |
Label
The text object for displaying the label
Declaration
public TextMeshPro Label { get; }
Property Value
Type | Description |
---|---|
TextMeshPro |
Owner
The owner of this arrow prompt. If the owner is destroyed, so is the prompt
Declaration
public GameObject Owner { get; }
Property Value
Type | Description |
---|---|
GameObject |
OwnerSet
Does this prompt have an owner configured?
Declaration
public bool OwnerSet { get; }
Property Value
Type | Description |
---|---|
bool |
Renderer
The main sprite of the prompt
Declaration
public SpriteRenderer Renderer { get; }
Property Value
Type | Description |
---|---|
SpriteRenderer |
Shadow
The sprite for displaying a drop shadow
Declaration
public SpriteRenderer Shadow { get; }
Property Value
Type | Description |
---|---|
SpriteRenderer |
Methods
| Edit this page View SourceHide()
Hides the prompt. If DestroyOnHide is true, this will also destroy the prompt object when done
Declaration
public void Hide()
HideInstant()
Instantly hides the prompt
Declaration
public void HideInstant()
SetLabelText(string)
Sets the prompt's text to a new value
Declaration
public void SetLabelText(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text | The new text to set |
SetLabelTextLang(string, string)
Sets the prompt's text to a new value by finding the language key and sheetTitle
Declaration
public void SetLabelTextLang(string langKey, string sheetTitle = "Prompts")
Parameters
Type | Name | Description |
---|---|---|
string | langKey | The lang key to retrieve |
string | sheetTitle | The sheet title to retrie |
Show()
Shows the prompt
Declaration
public void Show()
ShowInstant()
Instantly shows the prompt
Declaration
public void ShowInstant()
Spawn(GameObject, Vector3)
Spawns a new arrow prompt. Use the Show() function to make the prompt visible
Declaration
public static WeaverArrowPrompt Spawn(GameObject owner, Vector3 spawnPosition)
Parameters
Type | Name | Description |
---|---|---|
GameObject | owner | The owner of the arrow prompt. If the owner is destroyed, so is the prompt |
Vector3 | spawnPosition | The position of the new prompt |
Returns
Type | Description |
---|---|
WeaverArrowPrompt | Returns an instance to the arrow prompt |
Spawn(Vector3)
Spawns a new arrow prompt. Use the Show() function to make the prompt visible
Declaration
public static WeaverArrowPrompt Spawn(Vector3 spawnPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | spawnPosition | The position of the new prompt |
Returns
Type | Description |
---|---|
WeaverArrowPrompt | Returns an instance to the arrow prompt |
Spawn(WeaverArrowPrompt, GameObject, Vector3)
Spawns a new arrow prompt. Use the Show() function to make the prompt visible
Declaration
public static WeaverArrowPrompt Spawn(WeaverArrowPrompt prefab, GameObject owner, Vector3 spawnPosition)
Parameters
Type | Name | Description |
---|---|---|
WeaverArrowPrompt | prefab | The arrow prompt prefab to spawn |
GameObject | owner | The owner of the arrow prompt. If the owner is destroyed, so is the prompt |
Vector3 | spawnPosition | The position of the new prompt |
Returns
Type | Description |
---|---|
WeaverArrowPrompt | Returns an instance to the arrow prompt |
Spawn(WeaverArrowPrompt, Vector3)
Spawns a new arrow prompt. Use the Show() function to make the prompt visible
Declaration
public static WeaverArrowPrompt Spawn(WeaverArrowPrompt prefab, Vector3 spawnPosition)
Parameters
Type | Name | Description |
---|---|---|
WeaverArrowPrompt | prefab | The arrow prompt prefab to spawn |
Vector3 | spawnPosition | The position of the new prompt |
Returns
Type | Description |
---|---|
WeaverArrowPrompt | Returns an instance to the arrow prompt |