2025-11-20 14:43:50 +08:00

28 lines
585 B
C#

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