82 lines
2.4 KiB
C#
82 lines
2.4 KiB
C#
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Uis
|
|
{
|
|
public class TycoonSelectCard : MonoBehaviour
|
|
{
|
|
|
|
[field: SerializeField, CLabel("카드 1")]
|
|
private GameObject Card01;
|
|
[field: SerializeField, CLabel("카드 2")]
|
|
private GameObject Card02;
|
|
[field: SerializeField, CLabel("카드 3")]
|
|
private GameObject Card03;
|
|
|
|
private GameObject currentCard01;
|
|
private GameObject currentCard02;
|
|
private GameObject currentCard03;
|
|
|
|
private TycoonCard tycoonCard01Componet;
|
|
private TycoonCard tycoonCard02Componet;
|
|
private TycoonCard tycoonCard03Componet;
|
|
|
|
[Button("카드 생성하기(레벨업)")]
|
|
private void CreateCard()
|
|
{
|
|
if (!Application.isPlaying) return;
|
|
|
|
// 기존 카드가 있으면 삭제
|
|
if (currentCard01 != null)
|
|
{
|
|
Destroy(currentCard01);
|
|
}
|
|
if (currentCard02 != null)
|
|
{
|
|
Destroy(currentCard02);
|
|
}
|
|
if (currentCard03 != null)
|
|
{
|
|
Destroy(currentCard03);
|
|
}
|
|
|
|
currentCard01 = Instantiate(Card01, this.transform);
|
|
currentCard01.name = "Card01";
|
|
|
|
currentCard02 = Instantiate(Card02, this.transform);
|
|
currentCard02.name = "Card02";
|
|
|
|
currentCard03 = Instantiate(Card03, this.transform);
|
|
currentCard03.name = "Card03";
|
|
|
|
currentCard01.transform.localPosition = new Vector3(-550, 0, 0);
|
|
currentCard02.transform.localPosition = new Vector3(0, 0, 0);
|
|
currentCard03.transform.localPosition = new Vector3(550, 0, 0);
|
|
|
|
tycoonCard01Componet = currentCard01.GetComponent<TycoonCard>();
|
|
tycoonCard02Componet = currentCard02.GetComponent<TycoonCard>();
|
|
tycoonCard03Componet = currentCard03.GetComponent<TycoonCard>();
|
|
|
|
tycoonCard01Componet.Rotation_Start();
|
|
tycoonCard02Componet.Rotation_Start();
|
|
tycoonCard03Componet.Rotation_Start();
|
|
}
|
|
|
|
|
|
private void Awake()
|
|
{
|
|
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|