UI HUGE UPDATE

This commit is contained in:
FloatGaming
2026-06-25 11:48:56 +08:00
parent bd2a06f4c7
commit b2a1e307a4
1806 changed files with 359863 additions and 20822 deletions
+26
View File
@@ -58,6 +58,11 @@ public class CharacterCardView : MonoBehaviour, IBeginDragHandler, IDragHandler,
/// Documentation text normalized.
public void beSelected()
{
if (!IsCharacterUnlocked(characterID))
{
return;
}
if (!isSelected)
{
isSelected = true;
@@ -79,6 +84,7 @@ public class CharacterCardView : MonoBehaviour, IBeginDragHandler, IDragHandler,
public void OnBeginDrag(PointerEventData eventData)
{
Debug.Log($"CharacterCardView OnBeginDrag: {gameObject.name}");
if (!IsCharacterUnlocked(characterID)) return;
if (characterImage == null || characterImage.sprite == null) return;
if (rootCanvas == null) rootCanvas = GetComponentInParent<Canvas>();
if (rootCanvas == null) return;
@@ -147,6 +153,26 @@ public class CharacterCardView : MonoBehaviour, IBeginDragHandler, IDragHandler,
dragGhost.transform.localPosition = localPoint;
}
private bool IsCharacterUnlocked(int id)
{
if (id <= 0)
{
return false;
}
AllyHero_SO[] heroes = Resources.LoadAll<AllyHero_SO>("");
for (int i = 0; i < heroes.Length; i++)
{
AllyHero_SO hero = heroes[i];
if (hero != null && hero.ally_heroID == id)
{
return hero.isUnlocked;
}
}
return false;
}
public void OnPointerEnter(PointerEventData eventData)
{
if (!enableHoverAnim || isDragging) return;