27 lines
851 B
C#
27 lines
851 B
C#
using System;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class FloatingAbilityInfo : MonoBehaviour
|
|
{
|
|
[SerializeField] private Vector3 offset;
|
|
[SerializeField] private TextMeshProUGUI abilityName;
|
|
[SerializeField] private TextMeshProUGUI powerStat;
|
|
[SerializeField] private TextMeshProUGUI cooldownStat;
|
|
[SerializeField] private TextMeshProUGUI projectileCountStat;
|
|
private void Update()
|
|
{
|
|
if (!Input.GetKey(KeyCode.LeftShift))
|
|
{
|
|
transform.position = Input.mousePosition - offset;
|
|
}
|
|
}
|
|
|
|
public void ShowInfo(PlayerAbility ability)
|
|
{
|
|
abilityName.text = ability.abilityName;
|
|
powerStat.text = $"Power: {ability.power}";
|
|
cooldownStat.text = $"Cooldown: {ability.cooldown}";
|
|
projectileCountStat.text = $"Projectiles: {ability.projectileCount}";
|
|
}
|
|
}
|