private IEnumerator successMatching() { Debug.Log(@"Found the other player. Will begin transit to network battle scene, Wait a moment..."); foundOpponent = true; messageLabel.text = string.Format("対戦相手が見つかりました!\n<size=25>あなたは<size=40>{0}</size>です</size>", PhotonNetwork.player.ID == 1 ? "<color=red>1P</color>" : "<color=blue>2P</color>"); statusLabel.text = @"あいて: " + IdentificationNameUtility.ParseName(PhotonNetwork.otherPlayers[0].NickName); cancelButton.interactable = false; PhotonNetwork.room.IsOpen = false; PhotonNetwork.isMessageQueueRunning = false; updateStartingCounter(3); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(2); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(1); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(0); SceneController.Instance.LoadScene(SceneName.NetworkBattle, 0.4f); }
public void OnJoinedLobby() { Debug.Log("OnJoinedLobby"); var name = PlayerPrefs.GetString(PlayerPrefsKey.PlayerName); var id = PhotonNetwork.AuthValues.UserId; PhotonNetwork.playerName = IdentificationNameUtility.Create(name, id); StartMatching(); }
protected override void Awake() { base.Awake(); photonView = GetComponent <PhotonView>(); groupManager.MinoDeleted += onMinoDeleted; director.PlayerNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.player.NickName); director.OpponentNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.otherPlayers[0].NickName); director.PlayerYouLabel.enabled = true; }
public void Set(RoomEntry entry) { if (entry == null) { Clear(); return; } opponentName.text = IdentificationNameUtility.ParseName(entry.RoomName); winsCount.text = $"{entry.Settings.WinsCount}"; fallSpeed.text = $"{entry.Settings.FallSpeed} m/s"; }
protected override void OnSceneReady(object sender, EventArgs args) { minoManager.HitMino += onHitMino; groupManager.MinoDeleted += onMinoDeleted; director.PlayerNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.player.NickName); director.OpponentNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.otherPlayers[0].NickName); director.PlayerYouLabel.enabled = true; StartCoroutine(updateAndSendPing()); ready(); }
public void StartByHost() { guest = false; // TODO: var settings = new RoomSettings { WinsCount = 2, FallSpeed = 1.5f, }; var name = IdentificationNameUtility.Create(PhotonNetwork.playerName, PhotonNetwork.AuthValues.UserId); roomManager.CreateRoom(name, settings); backButton.Inactive(); StartCoroutine(AnimationTransit.Out(createRoomTransit, () => { waitingManager.gameObject.SetActive(true); waitingManager.InMenu(() => backButton.Active()); gameObject.SetActive(false); })); }
protected override void OnSceneReady(object sender, EventArgs args) { this.PlayerMode = (GameMode)PhotonNetwork.player.CustomProperties["mode"]; this.OpponentMode = (GameMode)PhotonNetwork.otherPlayers[0].CustomProperties["mode"]; perspectives.Activate(PlayerSide.Player, PlayerMode); perspectives.Activate(PlayerSide.Opponent, OpponentMode); directorManager.SetMode(PlayerMode); director = directorManager.GetDirector(); director.OnGameOver += onGameOver; director.Initialize(); ui.PlayerNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.player.NickName); ui.OpponentNameLabel.text = IdentificationNameUtility.ParseName(PhotonNetwork.otherPlayers[0].NickName); StartCoroutine(updateAndSendPing()); ready(); }
private IEnumerator successMatching() { Debug.Log(@"Found the other player. Will begin transit to network battle scene, Wait a moment..."); foundOpponent = true; messageLabel.text = @"対戦相手が見つかりました!"; statusLabel.text = @"あいて: " + IdentificationNameUtility.ParseName(PhotonNetwork.otherPlayers[0].NickName); cancelButton.interactable = false; PhotonNetwork.room.IsOpen = false; updateStartingCounter(3); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(2); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(1); yield return(new WaitForSeconds(1.0f)); updateStartingCounter(0); SceneController.Instance.LoadScene(SceneName.NetworkBattle, 0.4f); }
private void updateView() { GetComponentInChildren <Text>().text = IdentificationNameUtility.ParseName(RoomName); }