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.OnPointerDown

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

Parameters

eventDataThe EventData usually sent by the EventSystem.

Description

Evaluate current state and transition to pressed state.

#pragma strict
// Required when using Event data.
//Do this when the mouse is clicked over the selectable object this script is attached to.
public function OnPointerDown(eventData) {
	Debug.Log(this.gameObject.name + " Was Clicked.");
}