Table of Contents

Class ContextSubMenu

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Submenu implementation that opens on hover or click depending on SubMenuBehaviour. Inherits base layout/animation behavior from ContextMenuBase.

public class ContextSubMenu : ContextMenuBase
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
ContextSubMenu
Inherited Members

Methods

Close()

Triggers the popup animator to hide the context menu with animation and sets the menu as inactive.

public override void Close()

CloseOnClick()

Closes the menu on click.

public override void CloseOnClick()

Init(ModularContextMenu, List<ContextSubMenuItem>, SubMenuBehaviour, GameObject, GameObject, Button, bool)

Initializes submenu with configuration provided by parent menu.

public void Init(ModularContextMenu parentMenu, List<ContextSubMenuItem> menuItems, SubMenuBehaviour behaviour, GameObject itemButtonPrefab, GameObject separatorPrefab, Button modularButtonPrefab, bool isAutoPosition)

Parameters

parentMenu ModularContextMenu

Parent ModularContextMenu.

menuItems List<ContextSubMenuItem>

Submenu items to render.

behaviour SubMenuBehaviour

How submenu opens (hover or click).

itemButtonPrefab GameObject

Prefab for regular button items.

separatorPrefab GameObject

Prefab for separator items.

modularButtonPrefab Button

Prefab for modular button items.

isAutoPosition bool

If true, submenu auto-positions near parent.

OnPointerEnter(PointerEventData)

Use this callback to detect pointer enter events

public void OnPointerEnter(PointerEventData eventData)

Parameters

eventData PointerEventData

OnPointerExit(PointerEventData)

Use this callback to detect pointer exit events

public void OnPointerExit(PointerEventData eventData)

Parameters

eventData PointerEventData

Open()

Displays the context menu with an opening animation and sets its active state to true.

public override void Open()

UpdateContent()

Rebuilds submenu content and optionally repositions based on parent settings.

public void UpdateContent()