public ClientMultiPlayGame(PlayGameInitData playGameInitData, MultiGameInfo multiGameInfo) { gameSignalingClient = new GameSignalingClient(multiGameInfo.myTcpClient); gameSignalingClient.ReceivedBattleResult += CheckDeath; var playerMeleeAttackEntity = Object.Instantiate(playGameInitData.meleeAttackPrefab); playerMeleeAttackEntity.gameObject.layer = LayerMask.NameToLayer("PlayerBullet"); var enemyMeleeAttackEntity = Object.Instantiate(playGameInitData.meleeAttackPrefab); enemyMeleeAttackEntity.gameObject.layer = LayerMask.NameToLayer("EnemyBullet"); playerBotController = new ClientBotController( playGameInitData.botEntityPrefab2P, playGameInitData.tileMapInfo, playGameInitData.bulletPrefab, playGameInitData.cameraFollower, playGameInitData.playerHpPresenter, playGameInitData.runButtonEvent, playGameInitData.scriptText, playGameInitData.errorMsg, playGameInitData.soundManager, gameSignalingClient, playerMeleeAttackEntity, playGameInitData.processScrollViewPresenter, playGameInitData.eventSystemWatcher ); enemyBotController = new RemoteHostBotController( playGameInitData.botEntityPrefab, playGameInitData.tileMapInfo, playGameInitData.bulletPrefab, playGameInitData.soundManager, gameSignalingClient, enemyMeleeAttackEntity, playGameInitData.eventSystemWatcher ); gameSignalingClient.ReceivedClientPos += playerBotController.SetPos; gameSignalingClient.ReceivedHostPos += enemyBotController.SetPos; }
public HostMultiPlayGame(PlayGameInitData playGameInitData, MultiGameInfo multiGameInfo) { gameSignalingHost = new GameSignalingHost(multiGameInfo.myTcpClient, SelectedStageData.GetSelectedStageKind()); var playerMeleeAttackEntity = Object.Instantiate(playGameInitData.meleeAttackPrefab); playerMeleeAttackEntity.gameObject.layer = LayerMask.NameToLayer("PlayerBullet"); var enemyMeleeAttackEntity = Object.Instantiate(playGameInitData.meleeAttackPrefab); enemyMeleeAttackEntity.gameObject.layer = LayerMask.NameToLayer("EnemyBullet"); playerBotController = new HostBotController( playGameInitData.botEntityPrefab, playGameInitData.tileMapInfo, playGameInitData.bulletPrefab, playGameInitData.cameraFollower, playGameInitData.playerHpPresenter, playGameInitData.runButtonEvent, playGameInitData.scriptText, playGameInitData.errorMsg, playGameInitData.soundManager, gameSignalingHost, playerMeleeAttackEntity, playGameInitData.processScrollViewPresenter, playGameInitData.eventSystemWatcher ); enemyBotController = new RemoteClientBotController( playGameInitData.botEntityPrefab2P, playGameInitData.tileMapInfo, playGameInitData.bulletPrefab, playGameInitData.soundManager, gameSignalingHost, enemyMeleeAttackEntity, playGameInitData.eventSystemWatcher ); }
//クライアント側がマルチプレイゲーム画面へ移動する public static void ChangeClientMultiPlayScene(StageKind stageKind, MultiGameInfo multiGameInfo) { SelectedStageData.SetSelectedStageKind(stageKind); StartGameInfo.StartGameInfo.SetMultiPlay(multiGameInfo); SceneManager.LoadScene("SinglePlayGameScene"); }
//マルチプレイでステージ選択画面へ移動する public static void ChangeMultiPlayStageSelect(MultiGameInfo multiGameInfo) { StartGameInfo.StartGameInfo.SetMultiPlay(multiGameInfo); SceneManager.LoadScene("StageSelectScene"); }