public void OnClick() { GameObject Go = EventSystem.current.currentSelectedGameObject; int nr = int.Parse(Go.name.Replace("Button", "")); logic.ClickPicture(nr); GameObject Score = GameObject.Find("Score"); Score.GetComponent <Text>().text = "Score:\n" + logic.Counter.ToString(); }
private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { int nr = int.Parse(((PictureBox)sender).Tag.ToString()); Logic.ClickPicture(nr); }