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.
- Listed in Players and characters
- Inherits or implements
ScaleLerpPooledObject
Constructors
| Member | What it is |
|---|---|
QuickAccessMenuBubble() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private Material activeBubbleMaterial | PC material for a bubble whose action can run. |
private Material activeBubbleMaterialAndroid | Android material for a bubble whose action can run. |
private GameObject activePrefab | Visual prefab from the action, placed inside the bubble at 0.4 scale. Destroyed when the fade ends. |
private float animatingScale | Not used in this build. |
private Renderer bubbleRenderer | Renderer whose material shows whether the action is active. |
private QuickAccessMenuAction content | The quick access action this bubble shows and runs. |
private TextRenderer headingText | Text renderer for a heading. Not used by this class's own code. |
private Material inactiveBubbleMaterial | PC material for a bubble whose action can't run right now. |
private Material inactiveBubbleMaterialAndroid | Android material for a bubble whose action can't run right now. |
private bool isBubbleSelected | Whether the bubble is selected, so it can reselect when the action becomes valid again. |
private float scaleAnimationSpeed | Speed of the scale animation between selected and unselected. |
private float selectedScale | Scale when selected (2 by default), unless the action overrides it. |
private float unselectedScale | Scale when not selected (1 by default). |
Properties
| Member | What 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
| Member | What 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
Used in
Members of other types that take, return or hold a QuickAccessMenuBubble:
NestingMenuAction.CheckClose, NestingMenuAction.currentBubble, NestingMenuAction.MarkSelected, NestingMenuAction.spawnedBubbles, QuickAccessMenuAction.MarkSelected, QuickAccessMenuController.AddNested, QuickAccessMenuController.cachedClosestMenu, QuickAccessMenuController.ClosestMenuHasChanged, QuickAccessMenuController.newBubbleMarked, QuickAccessMenuController.RemoveNested, QuickAccessMenuController.spawnedMenus, QuickAccessMenuController.UpdateMarkClosestMenu, QuickAccessMenuSettings.PlaySelectMenuEffects, QuickAccessMenuSettings.QuickAccessMenuBubbleSelectEvent.Invoke.