more enemy stuff
This commit is contained in:
parent
3b60583c76
commit
d8c49317a3
235 changed files with 27781 additions and 3909 deletions
|
|
@ -1,14 +1,33 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class UpgradeBoxUI : MonoBehaviour
|
||||
public class UpgradeBoxUI : MonoBehaviour, IDropHandler
|
||||
{
|
||||
[SerializeField] private TextMeshProUGUI counterUI;
|
||||
public Image upgradeImage;
|
||||
public AbilityUpgrade thisAbilityUpgrade;
|
||||
public PlayerAbility thisPlayerAbility;
|
||||
public void UpdateCounter()
|
||||
{
|
||||
if (!thisAbilityUpgrade)
|
||||
{
|
||||
counterUI.gameObject.SetActive(false);
|
||||
return;
|
||||
}
|
||||
counterUI.gameObject.SetActive(true);
|
||||
counterUI.text = $"x{thisAbilityUpgrade.count}";
|
||||
}
|
||||
|
||||
public void OnDrop(PointerEventData eventData)
|
||||
{
|
||||
Debug.Log("A");
|
||||
if (eventData.pointerDrag.TryGetComponent(out StoredAbilityUpgradeUI isStoredUpgrade) && (!thisAbilityUpgrade || isStoredUpgrade.storedUpgrade == thisAbilityUpgrade))
|
||||
{
|
||||
thisAbilityUpgrade = isStoredUpgrade.storedUpgrade;
|
||||
AbilityManager.instance.AddUpgrade(thisAbilityUpgrade, thisPlayerAbility);
|
||||
UpdateCounter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue