Table of Contents

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
object
Object
Component
Behaviour
MonoBehaviour
ContextMenuArea

Methods

Init(ModularContextMenu)

Initializes the area with a target ModularContextMenu and configures the raycast receiver.

public void Init(ModularContextMenu contextMenu)

Parameters

contextMenu ModularContextMenu

Target 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

eventData PointerEventData

Pointer event data including button and position.