UI HUGE UPDATE
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user