Skip to main content

QuickAccessMenuBubble

A class in Root.Township, Alta.QuickAccessActions.

One bubble in the quick access menu, showing an action and running it when chosen. A pooled object that faces the local player's head; client only.

Constructors​

MemberWhat it is
QuickAccessMenuBubble()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

13 private and internal fields
MemberWhat it is
private Material activeBubbleMaterialPC material for a bubble whose action can run.
private Material activeBubbleMaterialAndroidAndroid material for a bubble whose action can run.
private GameObject activePrefabVisual prefab from the action, placed inside the bubble at 0.4 scale. Destroyed when the fade ends.
private float animatingScaleNot used in this build.
private Renderer bubbleRendererRenderer whose material shows whether the action is active.
private QuickAccessMenuAction contentThe quick access action this bubble shows and runs.
private TextRenderer headingTextText renderer for a heading. Not used by this class's own code.
private Material inactiveBubbleMaterialPC material for a bubble whose action can't run right now.
private Material inactiveBubbleMaterialAndroidAndroid material for a bubble whose action can't run right now.
private bool isBubbleSelectedWhether the bubble is selected, so it can reselect when the action becomes valid again.
private float scaleAnimationSpeedSpeed of the scale animation between selected and unselected.
private float selectedScaleScale when selected (2 by default), unless the action overrides it.
private float unselectedScaleScale when not selected (1 by default).

Properties​

MemberWhat it is
QuickAccessMenuController Controller { get; private set; }The quick access menu controller that owns this bubble.
bool IsActive { get; }Whether the bubble's action can be used now.
int NestingLevel { get; }How many parent bubbles this one is nested under.
QuickAccessMenuBubble Parent { get; set; }The bubble this one opened from, or null.
protected override bool IsAlwaysUpdating { get; }Always true, so the bubble keeps turning to face the player.

Methods​

MemberWhat it is
void MarkSelected()Highlights the bubble (grows it) and shows its title, if the action is usable.
bool PlaySfx()Whether the default selection sound should play.
override void Release()Closes the action, clears the parent and returns the bubble to the pool.
bool Run(Controller controller)Runs the action if usable; returns whether it has a run effect.
void UnmarkSelected()Shrinks the bubble back and clears the title.
void UpdateContent(QuickAccessMenuAction content, QuickAccessMenuController controller)Fills the bubble with an action: name, preview object, material, and opens the action.
protected override void FadeFinished()Destroys the action's preview object when the bubble has faded out.
protected override void UpdateLerp()Turns the bubble to face the local player's head, then updates its scale.
2 private and internal methods
MemberWhat it is
private void UpdateActive(bool isActive)Swaps the bubble material for active or inactive (PC or Android set) and unselects it when it goes inactive.
private void UpdateTitleDisplay(bool showTitle)Shows the action's display name (or asset name) as the menu's centred title, or clears it.

Used in​

Members of other types that take, return or hold a QuickAccessMenuBubble: