Ejemplo n.º 1
0
    public void SetRandom()
    {
        var allTypes = Enum.GetValues(typeof(SlotType));

        foreach (var slot in slots)
        {
            var randomType   = (SlotType)(Random.Range(0, allTypes.Length));
            var slotResource = _parent.GetSlotByType(randomType);
            slot.background.sprite = slotResource.background;
            slot.icon.sprite       = slotResource.icon;
            slot.type = slotResource.type;
        }
    }