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(); } } } }
public void OnDrop(PointerEventData eventData) { eventData.pointerDrag.gameObject.transform.SetParent(transform); RecetteLevelManager.Instance().AddIngredient(eventData.pointerDrag.gameObject); if (TutoRecipeManager.Instance() != null && TutoRecipeManager.Instance().ReturnDemand()) { TutoRecipeManager.Instance().RequestDone(); } }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; } }
public void OnDrop(PointerEventData eventData) { if (eventData.pointerDrag.gameObject.GetComponent <Formes_Et_Ingredients>() != null) { breakAudioSource.Play(); Debug.Log(eventData.pointerDrag.name); if (TutoRecipeManager.Instance() != null && TutoRecipeManager.Instance().ReturnDemand()) { if (TutoRecipeManager.Instance().ReturnState() <= 4) { //LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject) ; //LevelManager.Instance().UnpopObject() ; Debug.Log("Tuto destroy"); LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject); LevelManager.Instance().PopParticularObject(1); //Destroy(eventData.pointerDrag.gameObject) ; } else if (TutoRecipeManager.Instance().ReturnState() == 6) { Debug.Log("Tuto destroy"); LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject); LevelManager.Instance().PopParticularObject(0); } } else { LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject); } } if (SceneManager.GetActiveScene().name == "Level_Tuto" && TutoManager.Instance().ReturnDemand()) { //TutoManager.Instance().RequestDone() ; if (TutoManager.Instance().ReturnState() == 3) { //LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject) ; //LevelManager.Instance().UnpopObject() ; Debug.Log("Tuto destroy"); LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject); LevelManager.Instance().PopParticularObject(1); //Destroy(eventData.pointerDrag.gameObject) ; } else if (TutoManager.Instance().ReturnState() == 5) { Debug.Log("Tuto destroy"); LevelManager.Instance().DestroyAObject(eventData.pointerDrag.gameObject); LevelManager.Instance().PopParticularObject(0); } } }
public void ClearList() { if (!LevelManager.Instance().ReturnLevelEnd()) { if (SceneManager.GetActiveScene().name == "Level_Tuto_Recipe" && !TutoRecipeManager.Instance().ReturnTutoState()) { } else { for (int i = 0; i < listOfIngredient.Count; i++) { Destroy(listOfIngredient[i]); } ClearIngredientList(); Debug.Log("Clear button press"); } } }