예제 #1
0
 public void DropShield()
 {
     if (currentCollectableShield != null)
     {
         currentCollectableShield.transform.parent = null;
         currentCollectableShield.DisableMeleeItem();
         if (currentCollectableShield.destroyOnDrop)
         {
             Destroy(currentCollectableShield.gameObject);
         }
         currentMeleeShield = null;
     }
 }
예제 #2
0
    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;
        }
    }