public void ExitLobby() { Application.LoadLevel("Lobby"); Time.timeScale = 1.0f; AudioManagerScript.Instance().bgm.enabled = true; LobbyScript.Instance().UIChagner(); }
void Start() { if (singleton != null) { GameObject.Destroy(gameObject); } else { GameObject.DontDestroyOnLoad(gameObject); singleton = this; } PlayerPrefs.SetString("Opponent Name", ""); // Testing purposes startGameButton.SetActive(false); switchColorButton.SetActive(false); clientReady = false; guestReady = false; nowHosting = false; cannotMakeServer = true; returnToMenuButton.SetActive(true); if (PlayerPrefs.GetString("Multiplayer Role").Equals("Host Local")) // If the player is the host { isHost = true; // They are the host HostLobbyLocal(); // Creates a lobby for the host PlayerPrefs.SetInt("Player Color", 0); } else // If not the host { isHost = false; // They are not the host PlayerPrefs.SetInt("Player Color", 1); FindLobbyLocal(); // Are looking for a local lobby GameObject.Find("Background").transform.Rotate(new Vector3(0, 0, 180)); } }
// Use this for initialization void Start() { AbilitiesManager.playerLoadedInLobby = false; lobbyInst = this; cDT = NetworkMessageEncoder.encoders[(int)NetworkEncoderTypes.CUSTOM_DATA_TRASMIT] as PlayerCustomDataTrasmitter; iDT = NetworkMessageEncoder.encoders[(int)NetworkEncoderTypes.IMAGE_DATA_TRANSMIT] as ImageDependenciesTransfer; mE = NetworkMessageEncoder.encoders[(int)NetworkEncoderTypes.MANIFEST] as ManifestEncoder; ResetGameplayNetworkHelpers(); lobbyText = LoadedData.GetSingleton <UIDrawer>().CreateScriptedObject(typeof(TextWrapper)); lobbyText.script.transform.position = UIDrawer.UINormalisedPosition(new Vector3(0.5f, 0.9f)); LoadedData.GetSingleton <UIDrawer>().GetTypeInElement <Text>(lobbyText).text = "Lobby"; progressOfFiles = LoadedData.GetSingleton <UIDrawer>().CreateScriptedObject(typeof(TextWrapper)); progressOfFiles.script.transform.position = UIDrawer.UINormalisedPosition(new Vector3(0.5f, 0.5f)); LoadedData.GetSingleton <UIDrawer>().GetTypeInElement <Text>(progressOfFiles).verticalOverflow = VerticalWrapMode.Overflow; startGame = LoadedData.GetSingleton <UIDrawer>().CreateScriptedObject(typeof(ButtonWrapper)); startGame.script.transform.position = UIDrawer.UINormalisedPosition(new Vector3(0.5f, 0.1f)); LoadedData.GetSingleton <UIDrawer>().GetTypeInElement <Text>(startGame, "Text").text = "Start Game"; LoadedData.GetSingleton <UIDrawer>().GetTypeInElement <Button>(startGame).onClick.AddListener(() => { ServerChannel sC = NetworkMessageEncoder.encoders[(int)NetworkEncoderTypes.SERVER_CHANNEL] as ServerChannel; sC.CommunicateServerSide(ServerSideMethods.START_GAME); }); }
private void CheckScene() { if (GameObject.Find("Lobby")) { lobby = GameObject.Find("Lobby").GetComponent <LobbyScript>(); game = null; } else if (GameObject.Find("GameManager")) { game = GameObject.Find("GameManager").GetComponent <GameScript>(); lobby = null; } }
void Start() { if (_instance != null) { Destroy(this.gameObject); return; } _instance = this; DontDestroyOnLoad(this); UIChagner(); }
public void Awake() { if (GameObject.FindGameObjectWithTag("OldLobby") == null) { Debug.Log("No Lobby"); lobby = this; } else { Destroy(GameObject.FindGameObjectWithTag("OldLobby")); lobby = this; } this.gameObject.tag = "OldLobby"; }
private void Start( ) { if (lobbyCanvasObj == null) { return; } _roomNameText = gameObject.GetComponent <TextMeshProUGUI> ( ); LobbyScript lobbyScript = lobbyCanvasObj.GetComponent <LobbyScript> ( ); if (roomListingEvent != null) { roomListingEvent(_roomNameText); } Debug.Log(_roomNameText); button = GetComponent <Button> ( ); button.onClick.AddListener(() => SelectThis(lobbyScript)); }
private void Start() { instance = this; try { if (ConnectionManager.instance.isServer) { startGameButton.gameObject.SetActive(true); startGameButton.interactable = false; } else { startGameButton.gameObject.SetActive(false); } } catch (NullReferenceException) { Debug.Log("Nothing happened here... see? no errors :)"); } }
public void SelectThis(LobbyScript lobby) { lobby.SelectRoom(this); }
// Use this for initialization void Start() { lb = GameObject.Find("LobbyManager").GetComponent <LobbyScript>(); }
public override void OnStartClient() { lobbyScript = GameObject.FindObjectOfType <LobbyScript>(); }
void Start() { StartCoroutine("ReadyMessage"); LobbyScript.Instance().UIChagner(); }