룰렛 UI 추가
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class RouletteSpin : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Roulette roulette;
|
||||
[SerializeField] private Button buttonSpin;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
buttonSpin.onClick.AddListener(()=>
|
||||
{
|
||||
buttonSpin.interactable = false;
|
||||
roulette.Spin(EndOfSpin);
|
||||
});
|
||||
}
|
||||
|
||||
private void EndOfSpin(RoulettePieceData selectedData)
|
||||
{
|
||||
buttonSpin.interactable = true;
|
||||
|
||||
Debug.Log($"{selectedData.index}:{selectedData.description}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user