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);
}
}
}
'Project > Skill Steal Girl' 카테고리의 다른 글
[SSG] 최종프로젝트 - LobbyScene 새게임, 이어하기 (0) | 2024.05.28 |
---|---|
[SSG] 최종프로젝트 프로토타입 - Load StartPreparedCard (0) | 2024.05.22 |
[SSG] 최종프로젝트 프로토타입 - SceneManager.LoadScene (public) (0) | 2024.05.20 |
[SSG] 최종프로젝트 프로토타입 -행동카드 클릭 이벤트 수정 (0) | 2024.05.13 |
[SSG] 최종프로젝트 프로토타입 - Instantiate Data Image 중복 삭제 (0) | 2024.05.10 |