Esempio n. 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));
    }
Esempio n. 2
0
    // Use this for initialization

    public static UI_UnitMiniView MakeView(ScriptableUnitConfig config, Color col, Transform tr)
    {
        GameObject      obj  = Instantiate(Resources.Load("UI/ui_unitminiview")) as GameObject;
        UI_UnitMiniView view = obj.GetComponent <UI_UnitMiniView>();

        view.Init(config, col);
        view.transform.SetParent(tr);

        view.transform.localScale = Vector3.one;

        return(view);
    }