Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Selectable.OnPointerEnter

Switch to Manual
public function OnPointerEnter(eventData: EventSystems.PointerEventData): void;

Parameters

eventDataThe EventData usually sent by the EventSystem.

Description

Evaluate current state and transition to appropriate state.

New state could be pressed or hover depending on pressed state.

#pragma strict
// Required when using Event data.
//Do this when the cursor enters the rect area of this selectable UI object.
public function OnPointerEnter(eventData) {
	Debug.Log("The cursor entered the selectable UI element.");
}