Class ContextMenuArea
- Namespace
- Fallencake.UI
- Assembly
- Fallencake.UI.dll
Click-capture area for a ModularContextMenu. Ensures a transparent UnityEngine.UI.Image is present to receive raycasts.
[DisallowMultipleComponent]
[RequireComponent(typeof(Image))]
public class ContextMenuArea : MonoBehaviour
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourContextMenuArea
Methods
Init(ModularContextMenu)
Initializes the area with a target ModularContextMenu and configures the raycast receiver.
public void Init(ModularContextMenu contextMenu)
Parameters
contextMenuModularContextMenuTarget context menu to be controlled by click events.
OnPointerClick(PointerEventData)
Handles pointer clicks to open/close the context menu. Left click closes when open; right click triggers UpdateContent().
public void OnPointerClick(PointerEventData eventData)
Parameters
eventDataPointerEventDataPointer event data including button and position.