private void TryUnequip(bool grip) { if (grip) { handEquipState = EquippedState.unequipped; } else { thisSwordController.DeactivatePower(); } }
public void HandActivated(bool gripped) { //if (gripped) //{ // handEquipState = EquippedState.shield; // //ritorno perchè lo stato scudo è prioritario // return; //} if (handEquipState == EquippedState.unequipped) { if (oppositeHand.handEquipState == EquippedState.bow) { if (TryPullBow(gripped)) { return; } } //if in sword-zone equip sword if (currentEquipZone == EquipZoneType.sword) { handEquipState = EquippedState.sword; currentlyEquipped = swordPrefab; currentlyEquipped.SetActive(true); thisSwordController = thisControllerModel.gameObject.GetComponent <Sword>(); thisSwordController.ActivatePower(); if (thisControllerModel) { thisControllerModel.SetActive(false); } } //in bow zone equib bow if (currentEquipZone == EquipZoneType.bow) { handEquipState = EquippedState.bow; currentlyEquipped = bowPrefab; currentlyEquipped.SetActive(true); if (thisControllerModel) { thisControllerModel.SetActive(false); } } } }
void Start() { handEquipState = EquippedState.unequipped; swordPrefab.SetActive(false); bowPrefab.SetActive(false); }