Exemple #1
0
    public static Box.Element getRandomBoxElement()
    {
        //get a random box based on their probabilities
        int i = UtilityTools.GetRandomWeightedIndex(typeWeights);

        //if by any chance the random doesn't work, random again but without the special one
        if (i < 0)
        {
            i = Random.Range(0, System.Enum.GetNames(typeof(Box.Element)).Length - 1);
        }

        return((Box.Element)i);
    }