change toggle sprite on click unity code example
Example 1: Changing scene on obj click
void OnMouseDown ()
{
SceneManager.LoadScene("Level2");
}
// make sure to use your level name
Example 2: how to make a button disapear on click in javafx
public void letterChosen(ActionEvent event) {
Button source = (Button) event.getSource();
source.setVisible(false);
System.out.println("pick: "+source.getUserData());
}