using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class OnlineGameScript : MonoBehaviour { // Status color Pending, not your turn, your turn, declined List statusColors = new List() { new Color32(234, 164, 17, 100), new Color32(255, 255, 24, 175), new Color32(0, 255, 0, 100), new Color32(75, 50, 75, 100) }; public Text gameStatusText; public Text gameTitleText; public enum Status { PENDING, OTHERS_TURN, YOUR_TURN, DECLINED } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void SetStatusColor(Status status) { if (status.Equals(Status.PENDING)) { this.GetComponent().color = statusColors[0]; } else if (status.Equals(Status.OTHERS_TURN)) { this.GetComponent().color = statusColors[1]; } else if (status.Equals(Status.YOUR_TURN)) { this.GetComponent().color = statusColors[2]; } else if (status.Equals(Status.DECLINED)) { this.GetComponent().color = statusColors[3]; } } public void SetTitleText(string text) { gameTitleText.text = text; } public void SetGameStatusText(string text) { gameStatusText.text = text; } }