public void ConfirmList() { if (!LevelManager.Instance().ReturnLevelEnd()) { if (listOfIngredient.Count != 0) { for (int i = 0; i < globalList.Count; i++) { if (listOfIngredient.Count == globalList[i].recetteForme.Count) { ingredientCorrect = 0; Debug.Log("Une recette a ce nombre d'ingredient"); for (int y = 0; y < listOfIngredient.Count; y++) { Debug.Log("La recette trouvé contient :" + globalList[i].recetteForme[y].formeImage + "comme ingredient" + y); Debug.Log(listOfIngredient[y].GetComponent <Formes_Et_Ingredients>().formActual.formeImage); if (globalList[i].recetteForme.Contains(listOfIngredient[y].GetComponent <Formes_Et_Ingredients>().formActual)) { Debug.Log("TRUE RECETTE PAS DANS L'ORDRE PUTAIN DE MERDE "); recetteAscomplish = globalList[i]; Debug.Log("J'ai trouvé un ingrédient au bon endroit !"); ingredientCorrect++; if (ingredientCorrect == listOfIngredient.Count) { RecetteDone(); Debug.Log("Recette faite : " + recetteAscomplish); } } /*if(globalList[i].recetteForme[y].formeImage == listOfIngredient[y].GetComponent<Formes_Et_Ingredients>().formActual.formeImage) * { * recetteAscomplish = globalList[i] ; * Debug.Log("J'ai trouvé un ingrédient au bon endroit !") ; * ingredientCorrect++ ; * * if(ingredientCorrect == listOfIngredient.Count) * { * RecetteDone() ; * } * }*/ } } } } if (SceneManager.GetActiveScene().name == "Level_Tuto_Recipe" && TutoRecipeManager.Instance() != null) { if (TutoRecipeManager.Instance().ReturnDemand() && TutoRecipeManager.Instance().ReturnState() == 8) { TutoRecipeManager.Instance().RequestDone(); } } } }
/////-------------Recette Manager ----------------//////// public void AddRecetteKnow(Scriptable_Recette recetteToAdd) { if (!recetteKnow.Contains(recetteToAdd)) { recetteKnow.Add(recetteToAdd); recetteKnowIdx.Add(recetteList.recetteList.IndexOf(recetteToAdd)); hadSaveARecipe = true; //Debug.Log(recetteList.recetteList.IndexOf(recetteToAdd) + "recette Index") ; } }
public void Change(Scriptable_Recette recetteAffiche) { for (int i = 0; i < (recetteAffiche.recetteForme.Count + recetteAffiche.recetteForme.Count - 1); i++) { if (loopNumber < recetteAffiche.recetteForme.Count && i % 2 == 0) { GameObject temps = Instantiate(standardImage, this.transform); temps.GetComponent <Image>().sprite = recetteAffiche.recetteForme[loopNumber].formeImage; temps.SetActive(true); //Debug.Log("change") ; loopNumber++; } else if (i % 2 == 1) { GameObject plusTemp = Instantiate(standardPlusImage, this.transform); plusTemp.GetComponent <Image>().sprite = plusSprite; plusTemp.SetActive(true); } } }