Example #1
0
 void Start()
 {
     gameManger            = FindObjectOfType <GameManager> ();
     currentSampleCocktail = FindObjectOfType <RandomCocktail> ();
     size        = currentSampleCocktail.ingredients.Length;
     ingredients = new Ingredient[size];
     for (int i = 0; i < size; i++)
     {
         ingredients [i] = new Ingredient();
     }
     ingredients [0].startHeight = 0.04f;
 }
Example #2
0
    public void StartNewRound()
    {
        Destroy(GameObject.Find(newSampleCocktailName));
        GameObject sampleCocktailGO = Instantiate(sampleCocktailPrefab, Vector3.zero, Quaternion.identity, sampleCocktailTransform);

        sampleCocktailGO.transform.localPosition = Vector3.zero;
        sampleCocktailGO.name = newSampleCocktailName;
        sampleCocktail        = sampleCocktailGO.GetComponent <RandomCocktail> ();
        Destroy(GameObject.Find(newPouringCocktailName));
        GameObject pouringCocktailGO = Instantiate(pouringCocktailPrefab, Vector3.zero, Quaternion.identity, pouringCocktailTransform);

        pouringCocktailGO.transform.localPosition = Vector3.zero;
        pouringCocktailGO.name = newPouringCocktailName;
        pouringCocktail        = pouringCocktailGO.GetComponent <PouringCocktail> ();
    }