2021년 4학년 1학기 기업연계프로젝트2 컴퓨터소프트웨어공학과 <원광투어팀> 팀장 : 송유진 팀원 : 김나영, 이경희, 한유진
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
609 B

5 years ago
  1. using Unity.FPS.Game;
  2. using UnityEngine;
  3. namespace Unity.FPS.Gameplay
  4. {
  5. public class HealthPickup : Pickup
  6. {
  7. [Header("Parameters")] [Tooltip("Amount of health to heal on pickup")]
  8. public float HealAmount;
  9. protected override void OnPicked(PlayerCharacterController player)
  10. {
  11. Health playerHealth = player.GetComponent<Health>();
  12. if (playerHealth && playerHealth.CanPickup())
  13. {
  14. playerHealth.Heal(HealAmount);
  15. PlayPickupFeedback();
  16. Destroy(gameObject);
  17. }
  18. }
  19. }
  20. }