Example #1
0
    public void OnEquip(AssignableSlotInstance slot)
    {
        isEquipped = true;
        if ((Object)SelectTool.Instance.selected == (Object)selectable)
        {
            SelectTool.Instance.Select(null, false);
        }
        GetComponent <KBatchedAnimController>().enabled = false;
        GetComponent <KSelectable>().IsSelectable       = false;
        MinionAssignablesProxy component        = slot.gameObject.GetComponent <MinionAssignablesProxy>();
        GameObject             targetGameObject = component.GetTargetGameObject();
        Effects component2 = targetGameObject.GetComponent <Effects>();

        if ((Object)component2 != (Object)null)
        {
            foreach (Effect effectImmunite in def.EffectImmunites)
            {
                component2.AddImmunity(effectImmunite);
            }
        }
        if (def.OnEquipCallBack != null)
        {
            def.OnEquipCallBack(this);
        }
        GetComponent <KPrefabID>().AddTag(GameTags.Equipped, false);
    }