Example #1
0
    public override void SetItem(Unlockable <TieredUnit> item, Action <Unlockable <TieredUnit> > button_Callback)
    {
        // MDebug.Log("SetItem " + item.Item.Tiers[0].Config.ID);
        base.SetItem(item, button_Callback);
        ClassNameTF.text = item.Item.Tiers[0].Config.ID;
        Portrait.Init(item.Item.Tiers[0].Config, Color.white);

        item.AddUnlockListener(Updated);
        InfoButtonTarget.AddComponent <UI_ButtonGetSet_ScriptableUnitConfig>().SetItem(item.Item.Tiers[0].Config, SetUnitInfo);

        UnitTiers.Init(TieredUnit.Unlocks(item.Item.Tiers, PlayerLevel.Instance));
    }
Example #2
0
    public static List<Unlockable<T>> MakeUnlockables<T, C>(List<C> configs, Levels level, Func<C, int> GetRequirement, Func<T, string> GetID, Func<C, T> GetItem, Action<T> CallBack)
    {
        List<Unlockable<T>> unlocks = new List<Unlockable<T>>();
        foreach (var c in configs)
        {
            Unlockable<T> unlockable = new Unlockable<T>(GetItem(c), level, GetRequirement(c), GetID);

            if(CallBack != null)
                 unlockable.AddUnlockListener(CallBack);

            unlocks.Add(unlockable);

        }

        return unlocks;
    }
Example #3
0
    public static List<Unlockable<T>> MakeUnlockables<T>(List<T> source, Levels level, Func<T, int> GetRequirement, Func<T, string> GetID, Action<T> CallBack)
    {
        List<Unlockable<T>> unlocks = new List<Unlockable<T>>();

        foreach (var c in source)
        {
            Unlockable<T> unlockable = new Unlockable<T>(c, level, GetRequirement(c), GetID);

            if(CallBack != null)
                 unlockable.AddUnlockListener(CallBack);
            unlocks.Add(unlockable);


        }

        return unlocks;
    }
Example #4
0
 public void SetUnlockable(Unlockable <BlaConfig> unlockables)
 {
     MDebug.Log("SET @" + unlockables.Item.requirement);
     unlockables.AddUnlockListener(Foo);
 }