IEnumerator GameLoopRoutine() { Debug.Log("GameLoopRoutine Begin"); Prototype.NetworkLobby.LobbyManager lobbyManager = Prototype.NetworkLobby.LobbyManager.s_Singleton; if (lobbyManager != null) { m_allPlayers = GameObject.FindGameObjectsWithTag("Player"); while (m_allPlayers.GetLength(0) < lobbyManager._playerNumber) { Debug.Log("PlayerNumber " + lobbyManager._playerNumber.ToString()); m_allPlayers = GameObject.FindGameObjectsWithTag("Player"); yield return(null); } yield return(new WaitForSeconds(0.5f)); // Map Setting //yield return new WaitForSeconds(1.0f); yield return(StartCoroutine("StartGame")); yield return(StartCoroutine("PlayGame")); yield return(StartCoroutine("EndGame")); //StartCoroutine("GameLoopRoutine"); } else { Debug.LogWarning("========= GAMEMANAGER WARNING! Launch game from Lobby scene only! ========="); } }
public override void OnStartClient() { base.OnStartClient(); _lobby = GameObject.Find("LobbyManager").GetComponent <Prototype.NetworkLobby.LobbyManager>(); _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); _ui = GameObject.Find("Manager").GetComponent <IVUIManager>(); for (int i = 0; i < _lobby.lobbySlots.Length; i++) { if (_lobby.lobbySlots[i] == null) { break; } else { playerNum++; playerName.Add(_lobby.lobbySlots[i].GetComponent <LobbyPlayer>().playerName); playerLoading.Add(false); } } GameObject[] Players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject p in Players) { p.GetComponent <IVPlayer>().id = playerName.IndexOf(p.GetComponent <IVPlayer>().playerName); players.Add(p.GetComponent <IVPlayer>().id, p.GetComponent <NetworkIdentity>()); Debug.Log(p.GetComponent <IVPlayer>().id + " / " + players[p.GetComponent <IVPlayer>().id]); } _ui.InitLoadingCanvas(playerName); }
void JoinMatch(NetworkID networkID, LobbyManager lobbyManager) { lobbyManager.matchMaker.JoinMatch(networkID, "", lobbyManager.OnMatchJoined); lobbyManager.backDelegate = lobbyManager.StopClientClbk; lobbyManager._isMatchmaking = true; lobbyManager.DisplayIsConnecting(); }
/*Unity functions*/ //Initialization void Start() { Singleton = this; message_watcher = GetComponent <Message_board_watcher>(); lobbyManager = FindObjectOfType <Prototype.NetworkLobby.LobbyManager>(); onClientReady = new List <Action>(); lobbyManager.cvar_watcher = this; DontDestroyOnLoad(gameObject); }
public void ExitToMenu() { NetworkManager.singleton.StopClient(); NetworkManager.singleton.StopHost(); NetworkManager.singleton.StopMatchMaker(); GameObject lobbyManager = GameObject.Find("LobbyManager"); Prototype.NetworkLobby.LobbyManager l = lobbyManager.GetComponent <Prototype.NetworkLobby.LobbyManager>(); l.ChangeTo(l.mainMenuPanel); }
// Use this for initialization void Start() { var topPanel = GameObject.FindGameObjectWithTag("Trial"); lobby = topPanel.transform.parent.GetComponent <Prototype.NetworkLobby.LobbyManager> (); var click = GetComponent <Button> (); click.onClick.AddListener(delegate { Exit(); }); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); // set to true so we can return to the main menu options when lobby manager fixed GetComponent <Canvas>().enabled = false; //CHANGED DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
// Use this for initialization public override void OnStartServer() { Debug.Log("enter? " + gameObject.name); if (!isServer) { Destroy(gameObject); return; } _lobby = GameObject.Find("LobbyManager").GetComponent <Prototype.NetworkLobby.LobbyManager>(); _game = GameObject.Find("Manager").GetComponent <IVGameManager>(); _ui = GameObject.Find("Manager").GetComponent <IVUIManager>(); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void JoinMatch(NetworkID networkID, LobbyManager lobbyManager) { Debug.Log("JoinMatch triggered " + networkID); if (!lobbyManager._isMatchmaking) { Debug.Log("not matchmaking", lobbyManager); lobbyManager.StartMatchMaker(); } lobbyManager.matchMaker.JoinMatch(networkID, "", "", "", 0, 0, lobbyManager.OnMatchJoined); lobbyManager.backDelegate = lobbyManager.StopClientClbk; lobbyManager._isMatchmaking = true; lobbyManager.DisplayIsConnecting(); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); Utility.useRandomSourceID = MultiClient; SetServerInfo("Offline", "None"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); Application.targetFrameRate = 60; SetServerInfo("Offline", "None"); }
public void Populate(MatchDesc match, LobbyManager lobbyManager, Color c) { serverInfoText.text = match.name; slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString(); ; NetworkID networkID = match.networkId; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, lobbyManager); }); GetComponent<Image>().color = c; }
public void Populate(MatchInfoSnapshot match, LobbyManager lobbyManager, Color c) { serverInfoText.text = match.name; slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString();; NetworkID networkID = match.networkId; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, lobbyManager); }); GetComponent <Image>().color = c; }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("HORS-LIGNE", "Aucun"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); currentPlayers = new Dictionary <int, int>(); escapePanel.ToggleVisibility(false); }
void Start() { s_Singleton = this; currentPanel = mainMenuPanel; towers = new Dictionary <string, GameObject> (); startGameButton.gameObject.SetActive(false); backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("无"); }
void Start() { //SelectNetworkType (); netdisc = GetComponent <Discovery> (); netdisc.showGUI = false; roomList = roomListObj.GetComponent <LobbyRoomList> (); /* 画像を一番前に持ってくる関数 */ // titleback.transform.SetAsLastSibling(); countdownPanel.transform.SetAsLastSibling(); s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backDelegate = BackToPlayerNumber; GetComponent <Canvas>().enabled = true; NetworkStart(); DontDestroyManager.DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); if (KanjiTime.TitleManager.mode == KanjiTime.TitleManager.Mode.Single || KanjiTime.TitleManager.mode == KanjiTime.TitleManager.Mode.Tutorial) //ソロプレイモードまたはチュートリアルモード { hidePanel.SetActive(true); SetRoomName(); selectStagePanel.SetActive(true); selectPlayPanel.GetComponent <PlayerNumber>().MultiButton(); selectStagePanel.GetComponent <StageSelect>().RoomNameEnter(); RoomNameEnter(); Invoke("DisactiveHidePanel", 0.5f); } else if (KanjiTime.TitleManager.mode == KanjiTime.TitleManager.Mode.Host) //ホストモード { hidePanel.SetActive(false); SetRoomName(); selectStagePanel.SetActive(true); selectPlayPanel.GetComponent <PlayerNumber>().MultiButton(); } else if (KanjiTime.TitleManager.mode == KanjiTime.TitleManager.Mode.Client) //クライアントモード { hidePanel.SetActive(false); mainMenuPanel.GetComponent <LobbyMainMenu>().OnClickFindRoom(); OnStartClient(); roomList.RemoveRoomButton(); backButton.gameObject.SetActive(false); } }
public void PopulateEntry(string address, LobbyManager lobbyManager, Color c) { serverInfoText.text = address; slotInfo.text = "01/10"; string networkID = address; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, lobbyManager); }); GetComponent <Image>().color = c; }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); sButtonClickSound = sButtonClickSound.Remove(0, 7); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); _logonWindow = GameObject.Find("UserDetailsInfo").GetComponent <LogonManager>(); }
public virtual void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); backButton.onClick.AddListener(() => backDelegate()); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { Screen.orientation = ScreenOrientation.Landscape; s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; currentPlayers = new Dictionary <int, int> (); backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { networkAddress = Network.player.ipAddress; s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; topPanel.gameObject.SetActive(true); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); backDelegate = BackToMenu; SetServerInfo("Offline", "None"); }
void Start() { if (!File.Exists("userinfo.txt")) { StreamWriter sw = new StreamWriter("userinfo.txt"); sw.Close(); } if (!File.Exists("topscores.txt")) { StreamWriter sw = new StreamWriter("topscores.txt"); for (int i = 0; i < 10; i++) { sw.WriteLine(0); } sw.Close(); } if (!File.Exists("toptimes.txt")) { StreamWriter sw = new StreamWriter("toptimes.txt"); for (int i = 0; i < 10; i++) { sw.WriteLine(100000); } sw.Close(); } s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); HandleServerQuestion(); HideAll(); currentPanel = mainMenuPanel; normalChecked.enabled = true; fastChecked.enabled = false; heavyChecked.enabled = false; selectVehicleButton.enabled = true; VehicleSelectPanel.gameObject.SetActive(false); backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); lobbyCanvas.enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); ipAddress.text = Network.player.ipAddress; PvpMapManager.inst.OnBtnBack(); }
public void Populate(MatchInfoSnapshot match, LobbyManager lobbyManager, Color c) { serverInfoText.text = match.name; slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString();; NetworkID networkID = match.networkId; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, lobbyManager); print("aaaaaaaaaa"); a.SetActive(false); }); }
void JoinMatch(NetworkID networkID, LobbyManager lobbyManager) { _gDefense_Panel.SetActive(true); _gBack_Btn.GetComponent <Button>().interactable = false; Invoke("Defense_Panel_Off", 2.0f); _gRoom_Name.SetActive(false); _gSerRoom_Name.SetActive(true); _gRoom_Panel.SetActive(true); _gRoom_Game_Name.SetActive(true); _gSerRoom_Name.GetComponent <Text>().text = serverInfoText.text; lobbyManager.matchMaker.JoinMatch(networkID, "", "", "", 0, 0, lobbyManager.OnMatchJoined); lobbyManager.backDelegate = lobbyManager.StopClientClbk; lobbyManager._isMatchmaking = true; lobbyManager.DisplayIsConnecting(); }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent <Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent <Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); //randomspawnpoint = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };// }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent<Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; //backButton.gameObject.SetActive(false); GetComponent<Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); backDelegate = BackToMainMenuScene; if (FindObjectOfType<QuickplayLobby>() != null) isInQuickPlay = true; }
void Start() { s_Singleton = this; _lobbyHooks = GetComponent<Prototype.NetworkLobby.LobbyHook>(); currentPanel = mainMenuPanel; backButton.gameObject.SetActive(false); GetComponent<Canvas>().enabled = true; DontDestroyOnLoad(gameObject); SetServerInfo("Offline", "None"); }