Askor

HealthBar

Jan 2nd, 2022 (edited)
1,336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class HealthBar : Bar
  6. {
  7.     [SerializeField] private Player _player;
  8.  
  9.     public void OnEnable()
  10.     {
  11.         _player.HealthChanged += OnHealthChanged;
  12.     }
  13.  
  14.     private void OnDisable()
  15.     {
  16.         _player.HealthChanged -= OnHealthChanged;
  17.     }
  18. }
  19.  
Add Comment
Please, Sign In to add comment