Skip to main content

NestingMenuAction

A class in Root.Township, Alta.QuickAccessActions.

Quick access action that opens a fan of sub-bubbles for its nested actions when selected. Client only.

Constructors​

MemberWhat it is
NestingMenuAction()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private PooledObjectDefinition bubbleDefinitionPool definition for the sub-bubbles.
private QuickAccessMenuBubble currentBubbleThe bubble this action is shown in while open.
private bool isSelectedTrue while the sub-bubbles are out.
private QuickAccessMenuAction[] nestedActionsThe actions inside.
private float overrideSelectedScaleBacking field for OverrideSelectedScale.
private const float RadialSpaceInDegreesArc the sub-bubbles are spread over (180 degrees).
private readonly List<QuickAccessMenuBubble> spawnedBubblesSub-bubbles currently out.

Properties​

MemberWhat it is
override bool HasEffectOnRun { get; }False; choosing it does nothing itself.
override bool IsActive { get; }True if any nested action is active.
override bool IsIgnored { get; }Hidden if every nested action is ignored.
override bool IsValid { get; }True if any nested action is valid.
override float OverrideSelectedScale { get; }Scale of this bubble when selected.

Methods​

MemberWhat it is
override void Close()Collapses the sub-bubbles when the menu closes.
override void InitializeForPlayer(Player player, bool isDev)Also sets up every nested action for the player.
override void MarkSelected(QuickAccessMenuBubble bubble)On first selection, spawns the nested bubbles in a half circle around this bubble.
override void Run(Controller controller)Does nothing.
3 private and internal methods
MemberWhat it is
private void CheckClose(QuickAccessMenuBubble markedBubble)When another bubble is marked, collapses unless it is this bubble or one of its children.
private void Collapse()Releases the sub-bubbles and removes them from the controller.
private void SpawnNestedBubbles(Vector3 origin, Vector3 offsetDirection, Quaternion step)Spawns a pooled bubble for each non-ignored nested action along the arc.