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
-
objectObjectComponentBehaviourMonoBehaviourContextSubMenu
- 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
parentMenuModularContextMenuParent ModularContextMenu.
menuItemsList<ContextSubMenuItem>Submenu items to render.
behaviourSubMenuBehaviourHow submenu opens (hover or click).
itemButtonPrefabGameObjectPrefab for regular button items.
separatorPrefabGameObjectPrefab for separator items.
modularButtonPrefabButtonPrefab for modular button items.
isAutoPositionboolIf true, submenu auto-positions near parent.
OnPointerEnter(PointerEventData)
Use this callback to detect pointer enter events
public void OnPointerEnter(PointerEventData eventData)
Parameters
eventDataPointerEventData
OnPointerExit(PointerEventData)
Use this callback to detect pointer exit events
public void OnPointerExit(PointerEventData eventData)
Parameters
eventDataPointerEventData
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()