30 lines
723 B
C#
30 lines
723 B
C#
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}");
|
|
}
|
|
}
|
|
}
|