30 lines
693 B
C#
30 lines
693 B
C#
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class Player : Entity
|
|
{
|
|
[Header("UI")]
|
|
[SerializeField] private TextMeshProUGUI livesText;
|
|
private void Update()
|
|
{
|
|
if (Input.GetMouseButtonDown(0))
|
|
{
|
|
abilities[0].TryAbility();
|
|
}
|
|
if (Input.GetMouseButtonDown(1)) //this way kinda sucks but i'll fix it when i feel like it
|
|
{
|
|
abilities[1].TryAbility();
|
|
}
|
|
}
|
|
|
|
public override void TakeDamage(int damage)
|
|
{
|
|
base.TakeDamage(damage);
|
|
UpdateLivesUI();
|
|
}
|
|
private void UpdateLivesUI()
|
|
{
|
|
livesText.text = $"Lives: {health}/{maxHealth}";
|
|
}
|
|
}
|