using System.Collections; using Mirror; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Serialization; using UnityEngine.UI; using DG.Tweening; public class GameCanvas : MonoBehaviour { public static GameCanvas instance; const int OpponentWaitTimeoutSeconds = 15; static readonly WaitForSeconds WaitOneSecond = new WaitForSeconds(1f); int opponentWaitSecondsElapsed; bool hasShownOpponentTimeout; Coroutine opponentWaitRoutine; void Awake() { instance = this; ShowWaitingForOpponentPanel(); HideEmotesPanel(); HideAllPostGamePanels(); } void OnDestroy() { StopOpponentWaitRoutine(); } public EventTrigger gameInputPanel; public Image turnTimerSliderTransform; public Color redColor = Color.red; public Color blueColor = Color.blue; public TMP_Text blueTurnTimer; [FormerlySerializedAs("txtTurnTimer")] public TMP_Text redTurnTimer; public TMP_Text redName,blueName; public TMP_Text txtRcPrize; public TMP_Text txtWhosTurn; public Image blueTurnTimerRound; [FormerlySerializedAs("turnTimerRound")] public Image redTurnTimerRound; public GameObject waitingForOpponentPanel; public GameObject timeoutForOpponentPanel; public Button btnLeaveGame; [Header("Emotes")] public Button btnEmote; public Transform emotesPanel; public Transform textEmotesParent; public Transform emojiEmotesParent; public GameObject textEmotePrefab; public Transform EmoteSpawnRed, EmoteSpawnBlue; public Vector3 textEmoteMovement = new Vector3(0,100,0); public Vector3 emojiEmoteMovement = new Vector3(0,100,0); public float textEmoteDuration = 5f; public float emojiEmoteDuration = 5f; bool isShowingEmotes=> emotesPanel.gameObject.activeSelf; public RectTransform kickWarning; public GameObject[] postGamePanels; public TMP_Text txtMatchNumber; const float PostGamePanelDuration = 3f; void Start(){ if (btnLeaveGame != null) btnLeaveGame.onClick.AddListener(OnLeaveGamePressed); if(btnEmote != null) btnEmote.onClick.AddListener(OnEmotePressed); if(textEmotesParent != null){ for(int i=0; i().text; textEmotesParent.GetChild(i).GetComponent