using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using UnityEngine; public class RoundButtonsScript : MonoBehaviour { public Button newQuestionButton; public Button nextPlayerButton; private ScrollViewScript svs; private TimerScript ts; // Start is called before the first frame update void Start() { newQuestionButton.onClick.AddListener(NewQuestion); nextPlayerButton.onClick.AddListener(NextPlayer); svs = GameObject.Find("Scroll View").GetComponent(); ts = GameObject.Find("TimerCircle").GetComponent(); } void NewQuestion() { if (svs == null) { svs = GameObject.Find("Scroll View").GetComponent(); } Database db = GameObject.Find("GameManager").GetComponent(); NewQuestion q = db.GetNewQuestion(); q.SetAnswerText("???? - ????"); svs.SetNewQuestion(q); HidePanel(); ts.StartTimer(); } void NextPlayer() { svs.SetAllQuestionsLocked(true); svs.NextPlayer(); HidePanel(); } public void HidePanel() { CanvasGroup cg = this.GetComponent(); cg.alpha = 0F; cg.blocksRaycasts = false; } public void ShowPanel() { CanvasGroup cg = this.GetComponent(); cg.alpha = 1F; cg.blocksRaycasts = true; } }