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 = "Card";
|
|
|
|
_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()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|