예제 #1
0
    public static void Load()
    {
        Translations = ReferenceDepot <Translation> .Load(values => new Translation(values));

        DamageSets = ReferenceDepot <DamageSetConfig> .Load(values => new DamageSetConfig(values, Translations.Get(values[0], values[0].IndexOf("unq") > -1)));

        BaseEquipments = ReferenceDepot <BaseEquipment> .Load(values => new BaseEquipment(values, DamageSets.Get(values[0]).DamageSet, DamageSets.Get(values[0] + "_2", values[0].IndexOf("unq") >= -1)?.DamageSet ?? new DamageSet(), Translations.Get(values[0]).Value));

        Modifiers = ReferenceDepot <Modifier> .Load(values => new Modifier(values, DamageSets.Get(values[0])));

        Dictionary <ValueTuple <EquipmentType, Rarity>, List <Modifier> > mods = new Dictionary <ValueTuple <EquipmentType, Rarity>, List <Modifier> >();

        foreach (Modifier modifier in Modifiers.All())
        {
            ModPool.AddMod(modifier);
        }
    }
예제 #2
0
    public static ReferenceDepot <T> Load <T>(Func <string[], T> constructor) where T : ReferenceData
    {
        ReferenceDepot <T> depot = new ReferenceDepot <T>();

        string[] lines = Resources.Load <TextAsset>("Data/" + typeof(T)).text.Split('\n');
        for (int i = 1; i < lines.Length; i++)
        {
            if (string.IsNullOrEmpty(lines[i]))
            {
                break;
            }

            T entry = constructor(lines[i].Split('\t'));
            depot.Add(entry);
        }

        return(depot);
    }