/* * Añade funcionalidad a los botones de ready, not ready y start */ public void SetReadyButtonsFunctions(PlayerInfo localPlayer) { readyButton.onClick.RemoveAllListeners(); notReadyButton.onClick.RemoveAllListeners(); startButton.onClick.RemoveAllListeners(); if (!polePosition) { polePosition = FindObjectOfType <PolePositionManager>(); } if (localPlayer.isServer) { readyButton.gameObject.SetActive(false); notReadyButton.gameObject.SetActive(false); startButton.gameObject.SetActive(true); startButton.onClick.AddListener(() => polePosition.StartGame()); } else { readyButton.gameObject.SetActive(!localPlayer.ready); notReadyButton.gameObject.SetActive(localPlayer.ready); startButton.gameObject.SetActive(false); readyButton.onClick.AddListener(() => localPlayer.CmdSetReady(true)); notReadyButton.onClick.AddListener(() => localPlayer.CmdSetReady(false)); } }