public void DropShield() { if (currentCollectableShield != null) { currentCollectableShield.transform.parent = null; currentCollectableShield.DisableMeleeItem(); if (currentCollectableShield.destroyOnDrop) { Destroy(currentCollectableShield.gameObject); } currentMeleeShield = null; } }
public void SetMeleeShield(HumanBodyBones bodyPart) { var part = GetComponent <Animator>().GetBoneTransform(bodyPart); if (part) { var meleeShield = part.GetComponentInChildren <MeleeShield>(); var collectShield = part.GetComponentInChildren <CollectableMelee>(); currentMeleeShield = meleeShield; currentCollectableShield = collectShield; if (currentMeleeShield) { currentMeleeShield.Init(); } changeWeapon = false; } }