블랙잭 카드 기능 수정
This commit is contained in:
46
Assets/02_Scripts/Blackjack/CardSpawnTest.cs
Normal file
46
Assets/02_Scripts/Blackjack/CardSpawnTest.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class CardSpawnTest : MonoBehaviour
|
||||
{
|
||||
[Header("Card Prefab")]
|
||||
public GameObject cardPrefab;
|
||||
|
||||
[Header("Card Setting")]
|
||||
public float cardScale = 2f;
|
||||
|
||||
public Vector3 frontRotation = new Vector3(-90f, 0f, 90f);
|
||||
public Vector3 backRotation = new Vector3(90f, 0f, 90f);
|
||||
|
||||
[Header("Player Cards")]
|
||||
public Transform playerCardPos1;
|
||||
public Transform playerCardPos2;
|
||||
|
||||
[Header("Dealer Cards")]
|
||||
public Transform dealerOpenCardPos;
|
||||
public Transform dealerHiddenCardPos;
|
||||
|
||||
void Start()
|
||||
{
|
||||
SpawnCard(playerCardPos1, false);
|
||||
SpawnCard(playerCardPos2, false);
|
||||
|
||||
SpawnCard(dealerOpenCardPos, false);
|
||||
SpawnCard(dealerHiddenCardPos, true);
|
||||
}
|
||||
|
||||
void SpawnCard(Transform pos, bool faceDown)
|
||||
{
|
||||
GameObject card = Instantiate(cardPrefab, pos.position, Quaternion.identity);
|
||||
|
||||
card.transform.localScale = cardPrefab.transform.localScale * cardScale;
|
||||
|
||||
if (faceDown)
|
||||
{
|
||||
card.transform.rotation = Quaternion.Euler(backRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
card.transform.rotation = Quaternion.Euler(frontRotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Blackjack/CardSpawnTest.cs.meta
Normal file
2
Assets/02_Scripts/Blackjack/CardSpawnTest.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccf4c573a74c9cc4187ea85e8105e717
|
||||
Reference in New Issue
Block a user