Exemple #1
0
 void ChooseNewRecipe()
 {
     if (recipies.Count < 1)
     {
         gameManager.GameOver();
         gameManager.NameEng.text = "You Won!";
     }
     else
     {
         currentRecipe = recipies[Random.Range(0, recipies.Count)];
         recipies.Remove(currentRecipe);
         UpdateUI();
     }
 }
Exemple #2
0
    void Start()
    {
        recipies = new List <SushiRecipe>();
        SushiRecipe[] allRecipies = GetComponentsInChildren <SushiRecipe>();
        foreach (SushiRecipe rec in allRecipies)
        {
            recipies.Add(rec);
        }

        currentRecipe = recipies[Random.Range(0, recipies.Count)];
        print(currentRecipe.recipe[0]);
        print(currentRecipe.recipe[1]);
        print(currentRecipe.recipe[2]);
        recipies.Remove(currentRecipe);
        UpdateUI();
    }
Exemple #3
0
    IEnumerator ShowSushiImageAndPauseTheGame(SushiRecipe rec)
    {
        CancelInvoke();
        Player.SetActive(false);
        FinalImage.gameObject.SetActive(true);
        FinalImage.sprite = rec.FinalImage;
        NameEng.gameObject.SetActive(true);
        NameEng.text = rec.Name;
        NameJp.gameObject.SetActive(true);
        NameJp.text = rec.JpName;
        yield return(new WaitForSeconds(3f));

        Player.SetActive(true);
        FinalImage.gameObject.SetActive(false);
        NameEng.gameObject.SetActive(false);
        NameJp.gameObject.SetActive(false);
        InvokeRepeating("SpawnPieces", 1f, 1.2f);
    }
Exemple #4
0
 public void SushiCompleted(SushiRecipe rec)
 {
     StartCoroutine(ShowSushiImageAndPauseTheGame(rec));
 }