using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class SelectPreparedCard : MonoBehaviour
{
    
    public TMP_Text preparedCardName;
    public TMP_Text preparedCardDesc;
    public int id;


    public void UpdateCard(int id)
    {
        this.id = id;
        preparedCardName.text = PlayerManager.Instance.dicPreparedCardDatas[id].card_name;
        preparedCardDesc.text = PlayerManager.Instance.dicPreparedCardDatas[id].desc;

    }
}

 

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class SelectStartCard : MonoBehaviour
{
    public Transform content;
    public GameObject cardPrefab;


    void Start()
    {
        PlayerManager.Instance.LoadPreparedCardData();
        PlayerManager.Instance.LoadPlayerSelectCardInfo();


        PreparedCardData[] prepareCards = new PreparedCardData[2];
        prepareCards[0] = PlayerManager.Instance.dicPreparedCardDatas[2000];
        prepareCards[1] = PlayerManager.Instance.dicPreparedCardDatas[2001];

        for (int i = 0; i < 2; i++){

            GameObject card = Instantiate(cardPrefab, content);
            SelectPreparedCard c = card.GetComponent<SelectPreparedCard>();
            c.id = prepareCards[i].id;
            c.UpdateCard(c.id);
        }
    }
}

+ Recent posts