NetworkPlayer 2.1

  1. Network Player 2.1 Windows 7
  2. Network Player 2 1 Download
  1. usingSystem.Collections;
  2. {
  3. public GUIManager guiManager;
  4. public GameObject PlayerManagerPrefab;
  5. publicstring PlayerName;
  6. privatestring MatchName =';
  7. privateint MatchMaxUsers =32;
  8. public List<MPPlayer> PlayerList =new List<MPPlayer>();
  9. public List<MapSetting> MapList =new List<MapSetting>();
  10. public MapSetting CurrentMap =null;
  11. publicbool IsMatchStarted =false;
  12. //General Multiplayer Modes
  13. public MPPlayer MyPlayer;
  14. {
  15. PlayerName = PlayerPrefs.GetString('PlayerName');
  16. DontDestroyOnLoad(gameObject);
  17. {
  18. }
  19. publicvoid StartServer(string servername, string serverpassword, int maxusers)
  20. MatchName = servername;
  21. MatchMaxUsers = maxusers;
  22. Network.InitializeServer(MatchMaxUsers, 2550, false);
  23. MasterServer.RegisterHost('DeathMatch', MatchName, ');
  24. }
  25. void OnServerInitialized()
  26. Server_PlayerJoinRequest(PlayerName, Network.player);
  27. {
  28. networkView.RPC('Server_PlayerJoinRequest', RPCMode.Server, PlayerName, Network.player);
  29. {
  30. networkView.RPC('Client_RemovePlayer', RPCMode.All, id);
  31. {
  32. {
  33. networkView.RPC('Client_AddPlayerToList', player, pl.PlayerName, pl.PlayerNetwork);
  34. networkView.RPC('Client_GetMultiplayerMatchSettings', player, CurrentMap.MapName, ', ');
  35. {
  36. }
  37. [RPC]
  38. void Server_PlayerJoinRequest(string playername, NetworkPlayer view)
  39. networkView.RPC('Client_AddPlayerToList', RPCMode.All, playername, view);
  40. void Client_AddPlayerToList(string playername, NetworkPlayer view)
  41. MPPlayer tempplayer =new MPPlayer();
  42. tempplayer.PlayerNetwork= view;
  43. if(Network.player view)
  44. MyPlayer = tempplayer;
  45. GameObject play = Network.Instantiate(PlayerManagerPrefab, Vector3.zero, Quaternion.identity, 5)as GameObject;
  46. }
  47. [RPC]
  48. {
  49. foreach(MPPlayer pl in PlayerList)
  50. if(pl.PlayerNetwork view)
  51. temppl = pl;
  52. }
  53. {
  54. }
  55. void Client_GetMultiplayerMatchSettings(string map, string mode, string others)
  56. CurrentMap = GetMap(map);
  57. {
  58. {
  59. {
  60. break;
  61. }
  62. returnget;
  63. void Client_LoadMultiplayerMap(string map, int prefix)
  64. //Network.SetLevelPrefix(prefix);
  65. }
  66. void OnGUI()
  67. if(!MyPlayer.PlayerIsAlive&& IsMatchStarted)
  68. if(IsMatchStarted && Input.GetKey(KeyCode.Tab))
  69. guiManager.ScoreBoard();
  70. }
  71. [RPC]
  72. {
  73. int numberspawn = Random.Range(0, Spawnpoints.Length-1);
  74. networkView.RPC('Client_SpawnPlayer', RPCMode.All, player, Spawnpoints[numberspawn].transform.position+new Vector3(0, 2, 0), Spawnpoints[numberspawn].transform.rotation);
  75. void Client_SpawnPlayer(NetworkPlayer player, Vector3 position, Quaternion rotation)
  76. MultiplayerManager.GetMPPlayer(player).PlayerIsAlive=true;
  77. MultiplayerManager.GetMPPlayer(player).PlayerHealth=100;
  78. {
  79. MyPlayer.PlayerManager.ControllerTransform.position= position;
  80. MyPlayer.PlayerManager.ControllerTransform.rotation= rotation;
  81. MyPlayer.PlayerManager.networkView.RPC('Client_PlayerAlive', RPCMode.All);
  82. else
  83. }
  84. void OnLevelWasLoaded()
  85. if(Application.loadedLevelName CurrentMap.MapLoadName&& Network.isServer)
  86. MatchLoaded =true;
  87. Spawnpoints = GameObject.FindGameObjectsWithTag('spawnpoint');
  88. networkView.RPC('Client_ServerLoaded', RPCMode.AllBuffered, IsMatchStarted);
  89. }
  90. [RPC]
  91. {
  92. IsMatchStarted = started;
  93. publicstatic MPPlayer GetMPPlayer(NetworkPlayer player)
  94. foreach(MPPlayer play in MultiplayerManager.instance.PlayerList)
  95. if(play.PlayerNetwork player)
  96. return play;
  97. }
  98. }
  99. //Deathmatch
  100. {
  101. if(GUI.Button(new Rect(5, Screen.height-40, 250, 35), 'Spawn'))
  102. if(Network.isServer)
  103. else
  104. networkView.RPC('Server_SpawnPlayer', RPCMode.Server, Network.player);
  105. }
  106. [RPC]
  107. publicvoid Client_UpdatePlayerHealthAndAlive(NetworkPlayer targetplayer, bool IsAlive, int CurrentHealth)
  108. MPPlayer player = MultiplayerManager.GetMPPlayer(targetplayer);
  109. player.PlayerHealth= CurrentHealth;
  110. }
  111. [System.Serializable]
  112. {
  113. public NetworkPlayer PlayerNetwork;
  114. publicint PlayerHealth =100;
  115. publicint PlayerScore;
  116. publicint PlayerDeahts;
  117. publicclass MapSetting
  118. publicstring MapName;
  119. public Texture MapLoadTexture;

Network Player 2.1 Windows 7

2.1NetworkPlayer 2.1

Network Player 2 1 Download

Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers. We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand. NETWORK PLAYER CONTROLLER is designed to control Yamaha network player which is communicated via a LAN cable by using smartphone / tablet. NETWORK PLAYER CONTROLLER - Overview - Apps - Audio & Visual - Products - Yamaha - Malaysia.