Exemplo n.º 1
0
    PotionElement GetRightNeighbourOf(PotionElement element)
    {
        int pos = potions.IndexOf(element);

        if (pos + 1 > potions.Count - 1)
        {
            return(potions[0]);
        }
        else
        {
            return(potions[pos + 1]);
        }
    }
Exemplo n.º 2
0
    PotionElement GetLeftNeighbourOf(PotionElement element)
    {
        int pos = potions.IndexOf(element);

        if (pos == 0)
        {
            return(potions[potions.Count - 1]);
        }
        else
        {
            return(potions[pos - 1]);
        }
    }
Exemplo n.º 3
0
    void Start()
    {
        if (potions.Count == 0)
        {
            Debug.LogError("Potion Selector Elements not assigned!");
        }

        mappedPotions = new Hashtable();
        //setup
        foreach (PotionElement potion in potions)
        {
            mappedPotions.Add(potion.type, potion);
            potion.SetEmpty(emptyPotion);
            potion.SetCount(0);
            potion.image.transform.localScale = initialScale;
        }
        selectedElement = potions[0];
        selectedElement.image.transform.localScale = selectedScale;
        instance = this;
    }