Advertisement
Askor

Bar

Jan 6th, 2022
836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using DG.Tweening;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6.  
  7. public abstract class Bar : MonoBehaviour
  8. {
  9.     [SerializeField]protected Slider _slider;
  10.  
  11.     private float _delayToFill = 0.5f;
  12.  
  13.     protected void OnHealthChanged(int value, int maxValue)
  14.     {
  15.         _slider.DOValue((float)value / maxValue, _delayToFill);
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement