Skip to content

Commit

Permalink
Fix main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan-senpi committed Nov 15, 2020
1 parent 92b46cb commit 3ddd196
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
32 changes: 18 additions & 14 deletions Assets/FillRecette.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,29 @@ public void SetFree()
}
internal void Fill(Recettte recettte)
{
IsFree = false;
nbIngrediant = recettte.Ingredients.Length;
recetteTimer.ResetTimer();
MainImage.sprite = recettte.Sprite;

for (int i = 0; i < Ingrediant.Length; i++)
try
{
if (i < recettte.Ingredients.Length)
{
Ingrediant[i].RawImage.texture = recettte.Ingredients[i].Sprite.texture;
Ingrediant[i].FoodState = recettte.Ingredients[i].FoodState;
Ingrediant[i].FoodType = recettte.Ingredients[i].FoodType;
IsFree = false;
nbIngrediant = recettte.Ingredients.Length;
recetteTimer.ResetTimer();
MainImage.sprite = recettte.Sprite;

}
else
for (int i = 0; i < Ingrediant.Length; i++)
{
Ingrediant[i].RawImage.texture = empty;
if (i < recettte.Ingredients.Length)
{
Ingrediant[i].RawImage.texture = recettte.Ingredients[i].Sprite.texture;
Ingrediant[i].FoodState = recettte.Ingredients[i].FoodState;
Ingrediant[i].FoodType = recettte.Ingredients[i].FoodType;

}
else
{
Ingrediant[i].RawImage.texture = empty;
}
}
}
catch { }
}

public void OnDrop(PointerEventData eventData)
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scenes/Scripts/Menu/ButtonMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ButtonMenu : MonoBehaviour
{
public void PlayGame()
{
SceneManager.LoadScene("Scene1");
SceneManager.LoadScene(1);
}

public void OnApplicationQuit()
Expand All @@ -16,6 +16,6 @@ public void OnApplicationQuit()

public void CreditScene()
{
SceneManager.LoadScene("Credit");
SceneManager.LoadScene(2);
}
}
3 changes: 2 additions & 1 deletion Assets/Scripts/Food/RecetteTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public void ResetTimer()
try
{
slider.maxValue = Random.Range(minTimer, maxTimer + 1);
slider.value = slider.maxValue;

}
catch { }
slider.value = slider.maxValue;
}
// Update is called once per frame
void Update()
Expand Down

0 comments on commit 3ddd196

Please sign in to comment.