using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class RandomGame : MonoBehaviour { public GameObject[] wins; public Button spin; public Button get; public Animator spina; private List WinI; public GameObject[] prise; float speed; private void Start() { for (int i = 0; i < wins.Length; i++) { WinI.Add(wins[i].GetComponent()); } } public void Spin(int Cost) { if (PlayerPrefs.GetInt("Moneys") >= Cost) { Invoke("SpinStop", 5); } speed = 100; SpeedDown(); spin.interactable = false; } public void SpinStop() { } void SpeedDown() { if (speed > 0) { speed--; Invoke("SpeedDown", 0.05f); } else { spin.interactable = true; } } private void Update() { for (int i = 0; i < prise.Length; i++) { prise[i].transform.Translate(new Vector3(speed/25, 0, 0)); } } }