the gameObject with the SpriteRenderer has a boxCollider2D. Now, I noticed that the OnMouseUp is never called when I click on the sprite with the mouse.
Why? , Shall I use Physics2D.RayCastHit2D instead?
Hi this is my configuration of the SpriteRender and the OnMouseUpAsButton function. But I was expenting the debug.log to print out the name of gameobject sprite, but nothing happens.
Any Clue? Thank you for trying my previous snippet.
void OnMouseUpAsButton() {
Debug.Log("name: " + gameObject.name);
if (TestIOSorAndroid() == false) {//If I am not running
//Jump to the Info pannel.
cameraNextPanel.gameObject.SetActive(true);
infoPanel2Activate.gameObject.SetActive(true);
//Only for the HOME button.
if (currentCamera != null) {
currentCamera.gameObject.SetActive(false);
}
//Disable current panel
if (transform.parent != null){
transform.parent.gameObject.SetActive(false);
}
}
}