void OnDestroy() { if (instance == this) { instance = null; } }
private void Start() { GameflowManager.GFM.OnGameEnded += OnEndGameHandler; EndGameMsg.SetActive(false); startNewGameKey.SetActive(false); PL = FindObjectOfType <PhotonLobby>(); }
private void Awake() { if (PhotonLobby.INSTANCE == null) { PhotonLobby.INSTANCE = this; } }
private void Awake() { if (Instance == null) { Instance = this; } }
void Awake() { if (instance == null) { instance = this; } }
private void Awake() { if (instance) { Destroy(this); return; } instance = this; }
public void CreateServer() { PhotonLobby lobby = ServiceLocator.GetServiceOfType <PhotonLobby>(); if (lobby.HostRoom(servernameInputfield.text, newServerPassworldInputfield.text)) { CloseSubWindow(serverCreationWindow); } }
private void Awake() { if (photonLobby == null) { photonLobby = this; } else if (photonLobby != this) { Destroy(gameObject); } Instantiate(room); }
public void TryToJoinRoom() { PhotonLobby pl = ServiceLocator.GetServiceOfType <PhotonLobby>(); if (pl.PasswordMatches(chosenRoom, passwordInputfield.text)) { pl.JoinRoom(chosenRoom); } else { ServiceLocator.GetServiceOfType <UIManager>().ShowMessage("The password does not match"); } }
public void Awake() { DontDestroyOnLoad(gameObject); if (PhotonLobby.photonLobby == null) { PhotonLobby.photonLobby = this; } else { Destroy(this.gameObject); } }
private void CheckForPassword(string serverName) { chosenRoom = serverName; PhotonLobby pl = ServiceLocator.GetServiceOfType <PhotonLobby>(); if (pl.ServerHasPassword(chosenRoom)) { print("Server has password"); OpenSubWindow(serverPasswordWindow); } else { pl.JoinRoom(chosenRoom); } }
private void Awake() { lobby = this; // create singleton, lives within the main menu scene // if(PhotonLobby.lobby == null) // { // PhotonLobby.lobby = this; // } else // { // if(PhotonLobby.lobby != this) // { // Destroy(PhotonLobby.lobby.gameObject); // PhotonLobby.lobby = this; // } // } }
private void Awake() { //lobby = this; //creates/initializes the singleton, lives within the Main menu scene if (lobby && lobby != this) { Destroy(gameObject); } else { lobby = this; } //PhotonNetwork.AutomaticallySyncScene = true; //this enables use of PhotonNetwork.LoadLevel() on master client and all clients in the same room sync their level automatically DontDestroyOnLoad(lobby); }
//Connect to master photon server. void Start() { if (PhotonLobby.lobby == null) { PhotonLobby.lobby = this; } else { if (PhotonLobby.lobby != this) { Destroy(PhotonLobby.lobby.gameObject); PhotonLobby.lobby = this; } } PhotonNetwork.ConnectUsingSettings(); roomListings = new List <RoomInfo>(); }
void Awake() { if (PhotonLobby.Lobby == null) { PhotonLobby.Lobby = this; } else { if (PhotonLobby.Lobby != this) { Destroy(PhotonLobby.Lobby.gameObject); PhotonLobby.Lobby = this; } } DontDestroyOnLoad(this.gameObject); GenericNetworkManager.OnReadyToStartNetwork += StartNetwork; }
private void Start() { _print(true, "Start begin"); roomOptions = new RoomOptions { IsVisible = true, IsOpen = true, MaxPlayers = maxPlayersPerRoom }; if (Lobby == null) { _print(true, "Start: Lobby == null"); Lobby = this; } if (Lobby != this) { _print(true, "Start: Lobby != this"); Destroy(Lobby.gameObject); Lobby = this; } DontDestroyOnLoad(gameObject); _print(true, "ConnectUsingSettings begin"); PhotonNetwork.ConnectUsingSettings(); _print(true, "Start finish"); }
void Update() { _sharks = GameObject.FindGameObjectsWithTag("Shark"); sharks = _sharks.Length; //Debug.Log(_sharks.Length); if (sharks > 2) { Destroy(_sharks[1]); } ; swimmers = _swimmers.Count; List <GameObject> itemsToRemove = new List <GameObject>(); foreach (var swim in _swimmers) { if (swim == null) { itemsToRemove.Add(swim); } } foreach (var dead in itemsToRemove) { _swimmers.Remove(dead); CreateAgent(this.agentPrefab); } lobby = GameObject.FindGameObjectWithTag("lobby").GetComponent <PhotonLobby>(); if (Input.GetKeyDown(KeyCode.Space)) { //SceneManager.LoadScene(0); lobby.OnCancelButtonClicked(); } }
public GameObject cancelButton; // Cancel the searching private void Awake() { lobby = this; //Creating a lobby using Singleton design pattern. }
private void Awake() { lobby = this; //creates the singleton, lives within the Main Menu scene }
void Awake() { lobby = this; Screen.sleepTimeout = SleepTimeout.NeverSleep; }
private void Awake() { lobby = this; }
private void Awake() { lobby = this; //Create the singleton, lives the Main menu scene; }
private void Awake() { Lobby = this;//Creates the singleton, lives within the Main menu screne }
private void Awake() { lobby = this; // Singleton }
private void Awake() { lobby = this; // For the singleton, lives within the main menu screen. }
private void Awake() { lobby = this; //Singleton in main menu scene }
private void Awake() { lobby = this; //creates singleton,lives within main menu scene. }
void Awake() { lobby = this; }
public void StartNetwork() { PhotonNetwork.ConnectUsingSettings(); Lobby = this; }
private void Awake() { lobby = this; //Creates singleton lobby }