the scarlet police still have me at gunpoint
This commit is contained in:
parent
2ca43ec836
commit
980deb5d09
6 changed files with 1467 additions and 39 deletions
|
|
@ -1,13 +1,15 @@
|
|||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class AbilityHotbarIcon : MonoBehaviour
|
||||
public class AbilityHotbarIcon : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
[SerializeField] private Transform cooldownBar;
|
||||
[SerializeField] private TextMeshProUGUI text;
|
||||
private bool onCooldown;
|
||||
private PlayerAbility thisAbility;
|
||||
[SerializeField] private FloatingAbilityInfo infoUI;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
|
@ -34,4 +36,15 @@ public class AbilityHotbarIcon : MonoBehaviour
|
|||
thisAbility = ability;
|
||||
text.text = thisAbility.abilityName;
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
infoUI.gameObject.SetActive(true);
|
||||
infoUI.ShowInfo(thisAbility);
|
||||
|
||||
}
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
infoUI.gameObject.SetActive(false);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
Assets/Scripts/Abilities/FloatingAbilityInfo.cs
Normal file
24
Assets/Scripts/Abilities/FloatingAbilityInfo.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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()
|
||||
{
|
||||
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}";
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Abilities/FloatingAbilityInfo.cs.meta
Normal file
2
Assets/Scripts/Abilities/FloatingAbilityInfo.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: db401d9221bccaffa86ad2f6e9259435
|
||||
|
|
@ -16,8 +16,8 @@ public class PlayerAbility : MonoBehaviour
|
|||
[Header("Stats")]
|
||||
public float basePower;
|
||||
public float power;
|
||||
public float baseProjectileCount;
|
||||
public float projectileCount;
|
||||
public int baseProjectileCount;
|
||||
public int projectileCount;
|
||||
public Dictionary<AbilityUpgrade, int> attachedUpgrades = new();
|
||||
|
||||
private void Start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue