示例#1
0
    // Start is called before the first frame update
    public void Setup(EquipSlot _slot, int _tier)
    {
        // No white items for testing
        rarity   = (Rarity)Random.Range(1, Rarity.GetNames(typeof(Rarity)).Length);
        slot     = _slot;
        tier     = _tier;
        prefixes = new List <Affix>();
        suffixes = new List <Affix>();

        // Change this to random between max & min of rarity - pre existing mods;
        for (int i = 0; i < (int)rarity; i++)
        {
            // Change to take in type of item
            prefixes.Add(AffixMaster.instance.GetRandomPrefix());
            suffixes.Add(AffixMaster.instance.GetRandomSuffix());
        }
        foreach (Affix n in prefixes)
        {
            n.Setup();
        }
        foreach (Affix n in suffixes)
        {
            n.Setup();
        }
        // Resize List
        stats = new List <object>(typeof(Affix).GetFields().Length);
        CalcStats();
    }