28 lines
585 B
C#
Raw Normal View History

2025-11-20 02:23:07 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Character : MonoBehaviour
{
2025-11-20 14:43:50 +08:00
[SerializeField] private int ID;
[SerializeField] private List<Card> ownedCardList;
2025-11-20 02:23:07 +08:00
private void Awake()
{
2025-11-20 14:43:50 +08:00
TurnManagerEvent.OnSetCardID += SetCardID;
}
private void OnDestroy()
{
TurnManagerEvent.OnSetCardID -= SetCardID;
2025-11-20 02:23:07 +08:00
}
2025-11-20 14:43:50 +08:00
private void SetCardID()
2025-11-20 02:23:07 +08:00
{
2025-11-20 14:43:50 +08:00
for (int i = 0; i < ownedCardList.Count; i++)
{
ownedCardList[i].SetID(int.Parse($"{ID}{i}"));
}
2025-11-20 02:23:07 +08:00
}
}