using System.Collections; using UnityEngine.EventSystems; using UnityEngine.UI; using UnityEngine.Networking; using UnityEngine; public class CustomGameNetworker : NetworkBehaviour { public CustomGame cg; private GameObject ChangeWhat; [SyncVar] public string GameMode = "Random"; [SyncVar] public string Map = "Random"; public void StartGame() { if (!isServer) return; RpcSetReady(); } [ClientRpc] public void RpcSetReady() { if (GameObject.FindGameObjectsWithTag("LobbyPlayer").Length > 0) { foreach (GameObject netPlayerObj in GameObject.FindGameObjectsWithTag("LobbyPlayer")) { NetworkLobbyPlayer netPlayer = netPlayerObj.GetComponent(); if (netPlayer.isLocalPlayer) netPlayer.SendReadyToBeginMessage(); } } } public void AddFriendButton() { if (!isServer) return; cg.AddFriendObj.SetActive(true); StartCoroutine(cg.ListFriend()); } public void KickPlayer() { if (!isServer) return; foreach (Transform child in cg.PlayersList.transform) { if (child.GetComponentInChildren().text != "Waiting...") { child.GetComponentInChildren().color = Color.red; child.GetComponentInChildren