public class LevelDesign : MonoBehaviour, IPointerDownHandler, IPointerUpHandler {
bool buttonDown = false;
public void OnPointerDown(PointerEventData ped)
{
buttonDown = true;
}
public void OnPointerUp(PointerEventData ped)
{
buttonDown = false;
}
void Update()
{
if(buttonDown)
{
print ("Call");
}
}
}
Side note: the OnClick event is actually called when you release the button so it would be Input.GetMouseButtonUp. It is even called after the OnPointerUp event.