//private void Update() //{ // if(can.activeInHierarchy) // { // Debug.Log("test"); // } //} public void ChoixElement() { UpdateAffiche(); //GetComponentInChildren<Text>().text = nbPiece.ToString(); int casChange = gm.Tab[int.Parse(gm.temp)]; gm.Tab[int.Parse(gm.temp)] = int.Parse(gameObject.name); sp = GetComponent <Button>().GetComponent <Image>().sprite; gm.ChangeSprite(sp); EnlevePiece(); //nbPiece--; if (casChange != 0) { //can.transform.GetChild(0).gameObject.transform.GetChild(casChange).GetComponent<Button>().GetComponent<Image>().color = Color.blue; //can.transform.GetChild(0).gameObject.transform.GetChild(casChange).GetComponent<SelectPiece>().nbPiece++; RajoutPiece(casChange); } //if(nbPiece!=0 && gameObject.name != "0") //{ // GetComponent<Button>().interactable = true; //} //if (gm.Verification()) //{ // //GameObject.FindGameObjectWithTag // GameObject.Find("CPuzzle").SetActive(false); //} can.SetActive(false); //Destroy(can.gameObject); gm.Selection(); }