public void TakeDamage(float damage) { if (hpCurrent == 100 && damage < 0) { return; } hpCurrent -= damage; SetPanelFade(); if (hpCurrent >= 0) { if (!animatorManager.animator.GetBool("isInteracting")) { animatorManager.PlayTargetAnimation("Idle Hurt", false); } } else { hpBar.enabled = false; hpBar.GetComponent <CanvasGroup>().alpha = 0; animatorManager.PlayTargetAnimation("Death", true); StartCoroutine(DeathTimer()); //hpPanel.color = Color.black; //hpPanel.CrossFadeAlpha(100, 0.01f, false); } }
private void OnTriggerEnter(Collider collided) { if (collided.tag == "Player") { Time.timeScale = 0; animatorManager.PlayTargetAnimation("Finding", true); playerStats.CollectibleCounter(); StartCoroutine(Wait()); StartCoroutine(SwordSpawn()); } }
public void HandleRolling() { if (playerManager.isInteracting) { return; } if (inputManager.rollFlag) { moveDirection = cameraObject.forward * inputManager.vertical; moveDirection += cameraObject.right * inputManager.horizontal; if (inputManager.moveAmount > 0) { animatorManager.PlayTargetAnimation("Rolling", true); animatorManager.animator.SetBool("isRolling", true); moveDirection.y = 0; Quaternion rollRotation = Quaternion.LookRotation(moveDirection); transform.rotation = rollRotation; } else { if (animatorManager.animator.GetBool("isGrounded")) { animatorManager.PlayTargetAnimation("Backstep", true); } } } }
public void HandleRollingAndBackStep() { if (animatorManager.animator.GetBool("isInteracting")) { return; } if (inputManager.rollFlag) { moveDirection = cameraObject.forward * inputManager.VerticalInput; moveDirection += cameraObject.right * inputManager.HorizontalInput; if (inputManager.moveAmount > 0) { animatorManager.PlayTargetAnimation("Rolling", true, false); moveDirection.y = 0; Quaternion rollRotation = Quaternion.LookRotation(moveDirection); transform.rotation = rollRotation; } else { InputManager.instance.rollFlag = false; } } }
public void HandleLightAttack(WeaponItem weapon) { if (animatorManager.animator.GetBool("canCombo") && lastAttack == weapon.OH_Light_Attack_2) { animatorManager.PlayTargetAnimation(weapon.OH_Light_Attack_3, true, true); lastAttack = weapon.OH_Light_Attack_3; } else if (animatorManager.animator.GetBool("canCombo") && lastAttack == weapon.OH_Light_Attack_1) { animatorManager.PlayTargetAnimation(weapon.OH_Light_Attack_2, true, true); lastAttack = weapon.OH_Light_Attack_2; } else { animatorManager.animator.SetBool("canCombo", true); animatorManager.PlayTargetAnimation(weapon.OH_Light_Attack_1, true, true); lastAttack = weapon.OH_Light_Attack_1; } }
public void HandleLightAttack() { weaponManager.LoadWeapon(true); animatorManager.PlayTargetAnimation(weapon.lightAttack, true); }