// Use this for initialization void Start() { instance = this; UpdateLaughCount(0); FlowchartScript = JokesFlowChart.GetComponent <Flowchart>(); CutsceneFlowchartScript = CutsceneFlowChart.GetComponent <Flowchart>(); Jokes = new List <Joke>(); // Initalize the list of jokes for (int i = 1; i <= TotalJokeCount; i++) { Jokes.Add(new Joke { Name = "Joke" + i }); } // Get reference to the lobbyHookscript so can get players var lobbyManager = GameObject.FindGameObjectWithTag("LobbyManager"); if (lobbyManager != null) { var lobbyHookScript = lobbyManager.GetComponent <NetworkLobbyHook>(); lobbyManagerScript = lobbyManager.GetComponent <NetworkLobbyManager>(); players = lobbyHookScript.players; } }
void Awake() { //manager =GameObject.Find("NET").GetComponent<NetworkManager>(); m = GameObject.Find("Lobby").GetComponent <NetworkLobbyManager> (); GameObject.Find("Connect Hall").GetComponent <UIPanel> ().alpha = 1; GameObject.Find("Connect Room").GetComponent <UIPanel> ().alpha = 0; }
protected void SetupNLM() { if (nlm == null) { nlm = FindObjectOfType <NetworkLobbyManager> (); } }
public void EndGame() { NetworkLobbyManager networkLobbyManager = GameObject.FindObjectOfType <NetworkLobbyManager>(); networkLobbyManager.ServerReturnToLobby(); //networkLobbyManager.StopServer(); }
private void InitLobby() { if (!this.m_Initialized) { this.m_LobbySceneLabel = new GUIContent("Lobby Scene", "The scene loaded for the lobby"); this.m_PlaySceneLabel = new GUIContent("Play Scene", "The scene loaded to play the game"); this.m_MaxPlayersLabel = new GUIContent("Max Players", "The maximum number of players allowed in the lobby."); this.m_MaxPlayersPerConnectionLabel = new GUIContent("Max Players Per Connection", "The maximum number of players that each connection/client can have in the lobby. Defaults to 1."); this.m_MinPlayersLabel = new GUIContent("Minimum Players", "The minimum number of players required to be ready for the game to start. If this is zero then the game can start with any number of players."); this.m_ShowLobbyGUIProperty = this.serializedObject.FindProperty("m_ShowLobbyGUI"); this.m_MaxPlayersProperty = this.serializedObject.FindProperty("m_MaxPlayers"); this.m_MaxPlayersPerConnectionProperty = this.serializedObject.FindProperty("m_MaxPlayersPerConnection"); this.m_MinPlayersProperty = this.serializedObject.FindProperty("m_MinPlayers"); this.m_LobbyPlayerPrefabProperty = this.serializedObject.FindProperty("m_LobbyPlayerPrefab"); this.m_GamePlayerPrefabProperty = this.serializedObject.FindProperty("m_GamePlayerPrefab"); NetworkLobbyManager target = this.target as NetworkLobbyManager; if ((Object)target == (Object)null) { return; } if (target.lobbyScene != string.Empty && (Object)this.GetSceneObject(target.lobbyScene) == (Object)null) { Debug.LogWarning((object)("LobbyScene '" + target.lobbyScene + "' not found. You must repopulate the LobbyScene slot of the NetworkLobbyManager")); target.lobbyScene = string.Empty; } if (target.playScene != string.Empty && (Object)this.GetSceneObject(target.playScene) == (Object)null) { Debug.LogWarning((object)("PlayScene '" + target.playScene + "' not found. You must repopulate the PlayScene slot of the NetworkLobbyManager")); target.playScene = string.Empty; } } this.Init(); }
private void Awake() { if (!netManager) { netManager = FindObjectOfType <NetworkLobbyManager>(); } }
// Use this for initialization void Start() { if (!netManager && GameObject.FindWithTag("LobbyManager")) { netManager = GameObject.FindWithTag("LobbyManager").GetComponent <NetworkLobbyManager>(); } }
protected void ShowLobbyScenes() { NetworkLobbyManager target = this.target as NetworkLobbyManager; if ((Object)target == (Object)null) { return; } SceneAsset sceneObject1 = this.GetSceneObject(target.lobbyScene); EditorGUI.BeginChangeCheck(); Object object1 = EditorGUILayout.ObjectField(this.m_LobbySceneLabel, (Object)sceneObject1, typeof(SceneAsset), false, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { if (object1 == (Object)null) { this.SetLobbyScene(target, string.Empty); } else if (object1.name != target.offlineScene) { if ((Object)this.GetSceneObject(object1.name) == (Object)null) { Debug.LogWarning((object)("The scene " + object1.name + " cannot be used. To use this scene add it to the build settings for the project")); } else { this.SetLobbyScene(target, object1.name); } } } SceneAsset sceneObject2 = this.GetSceneObject(target.playScene); EditorGUI.BeginChangeCheck(); Object object2 = EditorGUILayout.ObjectField(this.m_PlaySceneLabel, (Object)sceneObject2, typeof(SceneAsset), false, new GUILayoutOption[0]); if (!EditorGUI.EndChangeCheck()) { return; } if (object2 == (Object)null) { this.SetPlayScene(target, string.Empty); } else { if (!(object2.name != this.m_NetworkManager.onlineScene)) { return; } if ((Object)this.GetSceneObject(object2.name) == (Object)null) { Debug.LogWarning((object)("The scene " + object2.name + " cannot be used. To use this scene add it to the build settings for the project")); } else { this.SetPlayScene(target, object2.name); } } }
void Start() { gameObject.transform.localPosition = new Vector3(0, 0, 0); BlackBackground.rectTransform.sizeDelta = new Vector3(Screen.width, Screen.height, 0); LobbyManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <NetworkLobbyManager>(); menu = GameObject.FindGameObjectWithTag("Menu").GetComponent <Menu>(); }
public void FireProjectile() { if ((Time.time - lastFired) > cooldown) { lastFired = Time.time; //if(Network.peerType.Equals(NetworkPeerType.Disconnected)) //{ if (m_projectilePrefab) { //GameObject spawnedObject = (GameObject)Instantiate(m_projectilePrefab, m_projectileSource.position, Quaternion.identity); m_previouslySpawnedProjectile = NetworkLobbyManager.Instantiate <GameObject> (m_projectilePrefab, m_projectileSource.position, Quaternion.identity); if (m_previouslySpawnedProjectile) { Rigidbody rigidBody = m_previouslySpawnedProjectile.GetComponent <Rigidbody> (); if (rigidBody) { rigidBody.velocity = m_projectileSource.forward * m_impulseMagnitude; } } } //} //else //{ // // If networked, move functionality to networked component. m_observer.notify(); } //} }
public void Connect(string pass) { NetworkLobbyManager manager = GameObject.FindGameObjectWithTag("NetworkManager").GetComponent <NetworkLobbyManager>();; NetworkMatch match = manager.GetComponent <NetworkLobbyManager>().matchMaker; match.JoinMatch(ConnectGame.networkId, pass, manager.OnMatchJoined); }
void Awake () { //manager =GameObject.Find("NET").GetComponent<NetworkManager>(); m = GameObject.Find ("Lobby").GetComponent<NetworkLobbyManager> (); GameObject.Find ("Connect Hall").GetComponent<UIPanel> ().alpha = 1; GameObject.Find ("Connect Room").GetComponent<UIPanel> ().alpha = 0; }
// Use this for initialization void Start() { Cursor.visible = true; Cursor.lockState = CursorLockMode.Confined; if (GameObject.FindGameObjectWithTag("NetworkManager") == null) { Instantiate(MyLobbyManager); } if (Manager == null) { Manager = GameObject.FindGameObjectWithTag("NetworkManager"); } if (LobbyNet == null) { LobbyNet = Manager.GetComponent <NetworkLobbyManager>(); } //Hide all menus LobbyCreationMenu.enabled = false; ServerBrowser.enabled = false; DirectIPMenu.enabled = false; PasswordMenu.enabled = false; }
private void Start() { if (!isServer) { return; } // Find Network manager NetworkLobbyManager lobbyManager = FindObjectOfType <NetworkLobbyManager>(); // Find how many players were in the Lobby ExpectedPlayerCount = lobbyManager.numPlayers; // Find data collector dataCollector = FindObjectOfType <DataCollector>(); // Initialize player hand reference playerHands = new List <int> [4]; playerScores = new List <PlayerScore>(); player0Hand = new List <int>(); playerHands[0] = player0Hand; Player0Score = new PlayerScore(); playerScores.Add(Player0Score); player1Hand = new List <int>(); playerHands[1] = player1Hand; Player1Score = new PlayerScore(); playerScores.Add(Player1Score); player2Hand = new List <int>(); playerHands[2] = player2Hand; Player2Score = new PlayerScore(); playerScores.Add(Player2Score); player3Hand = new List <int>(); playerHands[3] = player3Hand; Player3Score = new PlayerScore(); playerScores.Add(Player3Score); // Initialize lists playerList = new List <Player>(); discardPile = new List <int>(); drawPile = new List <int>(); // If loading a saved game update scores if (dataCollector.LoadSavedGame) { savedPlayerNames = dataCollector.LoadNames(); savedPlayerScores = dataCollector.LoadScores(); for (int i = 0; i < savedPlayerScores.Count; i++) { playerScores[i].SetScore(savedPlayerScores[i]); } } // Set start timer startTimer = defaultStartTime; }
public override void OnStartClient() { if (LogFilter.Debug) { Debug.LogFormat("OnStartClient {0}", SceneManager.GetActiveScene().name); } base.OnStartClient(); NetworkLobbyManager lobby = NetworkManager.singleton as NetworkLobbyManager; /* * This demonstrates how to set the parent of the LobbyPlayerPrefab to an arbitrary scene object * A similar technique would be used if a full canvas layout UI existed and we wanted to show * something more visual for each player in that layout, such as a name, avatar, etc. * * Note: LobbyPAlayer prefab will be marked DontDestroyOnLoad and carried forward to the game scene. * Because of this, NetworkLobbyManager must automatically set the parent to null * in ServerChangeScene and OnClientChangeScene. */ if (lobby != null && SceneManager.GetActiveScene().name == lobby.LobbyScene) { gameObject.transform.SetParent(GameObject.Find("Players").transform); } }
public override void OnStartClient() { Debug.Log("enter? " + gameObject.name); base.OnStartClient(); _identity = GetComponent <NetworkIdentity>(); _lobby = GetComponent <NetworkLobbyManager>(); }
// Use this for initialization void Awake() { DontDestroyOnLoad(this.gameObject); nlp = GetComponent <NetworkLobbyPlayer> (); nlp.readyToBegin = true; NetworkLobbyManager nlm = FindObjectOfType <NetworkLobbyManager> (); // Debug.Log(nlm.startPositions.Count); }
//Zaczęcie matchmakera void StartMM() { MatchName = "default"; MatchSize = 6; MatchPass = ""; LobbyManager = gameObject.GetComponent <NetworkLobbyManager>(); LobbyManager.StartMatchMaker(); }
public override void OnInspectorGUI() { if (this.m_DontDestroyOnLoadProperty == null || this.m_DontDestroyOnLoadLabel == null) { this.m_Initialized = false; } this.InitLobby(); NetworkLobbyManager target = this.target as NetworkLobbyManager; if ((Object)target == (Object)null) { return; } this.serializedObject.Update(); EditorGUILayout.PropertyField(this.m_DontDestroyOnLoadProperty, this.m_DontDestroyOnLoadLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_RunInBackgroundProperty, this.m_RunInBackgroundLabel, new GUILayoutOption[0]); if (EditorGUILayout.PropertyField(this.m_LogLevelProperty)) { LogFilter.currentLogLevel = (int)this.m_NetworkManager.logLevel; } this.ShowLobbyScenes(); EditorGUILayout.PropertyField(this.m_ShowLobbyGUIProperty); EditorGUILayout.PropertyField(this.m_MaxPlayersProperty, this.m_MaxPlayersLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_MaxPlayersPerConnectionProperty, this.m_MaxPlayersPerConnectionLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_MinPlayersProperty, this.m_MinPlayersLabel, new GUILayoutOption[0]); EditorGUILayout.PropertyField(this.m_LobbyPlayerPrefabProperty); EditorGUI.BeginChangeCheck(); Object @object = EditorGUILayout.ObjectField("Game Player Prefab", (Object)target.gamePlayerPrefab, typeof(NetworkIdentity), false, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { if (@object == (Object)null) { this.m_GamePlayerPrefabProperty.objectReferenceValue = (Object)null; } else { NetworkIdentity networkIdentity = @object as NetworkIdentity; if ((Object)networkIdentity != (Object)null && (Object)networkIdentity.gameObject != (Object)target.gamePlayerPrefab) { this.m_GamePlayerPrefabProperty.objectReferenceValue = (Object)networkIdentity.gameObject; } } } EditorGUILayout.Separator(); this.ShowNetworkInfo(); this.ShowSpawnInfo(); this.ShowConfigInfo(); this.ShowSimulatorInfo(); this.serializedObject.ApplyModifiedProperties(); this.ShowDerivedProperties(typeof(NetworkLobbyManager), typeof(NetworkManager)); if (!Application.isPlaying) { return; } EditorGUILayout.Separator(); this.ShowLobbySlots(); }
void Awake() { this.enabled = true; m = GameObject.Find("Lobby").GetComponent <NetworkLobbyManager> (); GameObject.Find("Connect Hall").GetComponent <UIPanel> ().alpha = 1; GameObject.Find("Connect Room").GetComponent <UIPanel> ().alpha = 0; big = false; }
void Awake () { this.enabled = true; m = GameObject.Find ("Lobby").GetComponent<NetworkLobbyManager> (); GameObject.Find ("Connect Hall").GetComponent<UIPanel> ().alpha = 1; GameObject.Find ("Connect Room").GetComponent<UIPanel> ().alpha = 0; big = false; }
// Use this for initialization void Start() { manager = GetComponent <NetworkLobbyManager> (); SceneManager.sceneLoaded += OnLevelFinishedLoading; //if this is not the correct scene at start load the correct scene if (SceneManager.GetActiveScene().buildIndex != 0) { SceneManager.LoadScene(0); } }
void Start() { networkManager = (NetworkLobbyManager)NetworkManager.singleton; if (networkManager.matchMaker == null) { networkManager.StartMatchMaker(); } roomPassword = ""; }
public void LoadScene(int index) { if (lobbyManager != null) { Destroy(lobbyManager.gameObject); NetworkLobbyManager.Shutdown(); } Scene(index); }
public void LoadSceneAsync(int index) { if (lobbyManager != null) { Destroy(lobbyManager.gameObject); NetworkLobbyManager.Shutdown(); } StartCoroutine(SceneAsync(index)); }
private void Start() { StartMatchMaker(); //NetworkManager.singleton.StartMatchMaker(); //this.playScene = "stage_o"; <-ステージ決定に使う player = lobbyPlayerPrefab.GetComponent <CustumLobbyPlayer>(); NLM = gameObject.GetComponent <NetworkLobbyManager>(); StageSelect = false; this.showLobbyGUI = false; }
void Start() { networkManager = (NetworkLobbyManager)NetworkManager.singleton; if (networkManager.matchMaker == null) { networkManager.StartMatchMaker(); } RefreshRoomList(); }
void Awake() { networkLobbyManager = GetComponent <NetworkLobbyManager>(); screens = new List <GameObject>(); screens.Add(connectionOptions); screens.Add(lobbyScreen.gameObject); screens.Add(enterAddressScreen); screens.Add(connectingScreen); ChangeScreen(connectionOptions); }
// Use this for initialization void Start() { networkLobbyManager = GetComponent <NetworkLobbyManager>(); #if UNITY_EDITOR networkLobbyManager.StartHost(); #else networkLobbyManager.networkAddress = "127.0.0.1"; networkLobbyManager.StartClient(); #endif }
private void Awake() { if (lobbyManager) { Statics.lobbyManager = lobbyManager; } else { lobbyManager = Statics.lobbyManager; } }
void SetPlayScene(NetworkLobbyManager lobby, string sceneName) { var prop = serializedObject.FindProperty("m_PlayScene"); prop.stringValue = sceneName; var onlineProp = serializedObject.FindProperty("m_OnlineScene"); onlineProp.stringValue = ""; // this is set to empty deliberately to prevent base class functionality from interfering with LobbyManager EditorUtility.SetDirty(lobby); }
void SetLobbyScene(NetworkLobbyManager lobby, string sceneName) { var prop = serializedObject.FindProperty("m_LobbyScene"); prop.stringValue = sceneName; var offlineProp = serializedObject.FindProperty("m_OfflineScene"); offlineProp.stringValue = sceneName; EditorUtility.SetDirty(lobby); }
void Start() { manager = GetComponent<NetworkLobbyManager>(); connections = 0; PlayerPrefs.SetFloat("multi", 1); }
// Use this for initialization void Start () { manager = GetComponent<NetworkLobbyManager>(); manager.SetMatchHost("mm.unet.unity3d.com", 443, true); }
void Start () { m = GameObject.Find ("Lobby").GetComponent<NetworkLobbyManager> (); }
void Start() { pReady = false; pCount = 0; nlm = GameObject.Find("LobbyManager").GetComponent<NetworkLobbyManager>(); }
void Awake() { manager = GetComponent<NetworkLobbyManager>(); lobbyPlayer = GameObject.Find ("NameHolder").GetComponent<NameHolderSC> (); }
void Start() { //serverListener = GameObject.Find("NetworkDiscovery").GetComponent<spt_NetworkDiscovery>(); nlm = GameObject.Find("LobbyManager").GetComponent<NetworkLobbyManager>(); inLobby = true; pCount = 0; startButton = GameObject.Find("btn_Start").GetComponent<Button>(); p1B = GameObject.Find("btn_P1").GetComponent<Button>(); p2B = GameObject.Find("btn_P2").GetComponent<Button>(); }