Example #1
0
    public PlanetSpriteMatch GetRandomPlanetSpriteMatch()
    {
        int count = remainingSprites.Count;

        if (count <= 0)
        {
            return(defaultSpriteMatch);
        }

        int randomIndex       = UnityEngine.Random.Range(0, count);
        PlanetSpriteMatch spr = remainingSprites[randomIndex];

        remainingSprites.RemoveAt(randomIndex);

        if (count - 1 == 0)
        {
            foreach (var s in planetSprites)
            {
                remainingSprites.Add(s);
            }
        }
        return(spr);
    }
Example #2
0
 public PlanetInfo(string planetName, PlanetSpriteMatch spriteMatch)
 {
     this.planetName  = planetName;
     this.spriteMatch = spriteMatch;
 }