- usingSystem.Collections;
- {
- public GUIManager guiManager;
- public GameObject PlayerManagerPrefab;
- publicstring PlayerName;
- privatestring MatchName =';
- privateint MatchMaxUsers =32;
- public List<MPPlayer> PlayerList =new List<MPPlayer>();
- public List<MapSetting> MapList =new List<MapSetting>();
- public MapSetting CurrentMap =null;
- publicbool IsMatchStarted =false;
- //General Multiplayer Modes
- public MPPlayer MyPlayer;
- {
- PlayerName = PlayerPrefs.GetString('PlayerName');
- DontDestroyOnLoad(gameObject);
- {
- }
- publicvoid StartServer(string servername, string serverpassword, int maxusers)
- MatchName = servername;
- MatchMaxUsers = maxusers;
- Network.InitializeServer(MatchMaxUsers, 2550, false);
- MasterServer.RegisterHost('DeathMatch', MatchName, ');
- }
- void OnServerInitialized()
- Server_PlayerJoinRequest(PlayerName, Network.player);
- {
- networkView.RPC('Server_PlayerJoinRequest', RPCMode.Server, PlayerName, Network.player);
- {
- networkView.RPC('Client_RemovePlayer', RPCMode.All, id);
- {
- {
- networkView.RPC('Client_AddPlayerToList', player, pl.PlayerName, pl.PlayerNetwork);
- networkView.RPC('Client_GetMultiplayerMatchSettings', player, CurrentMap.MapName, ', ');
- {
- }
- [RPC]
- void Server_PlayerJoinRequest(string playername, NetworkPlayer view)
- networkView.RPC('Client_AddPlayerToList', RPCMode.All, playername, view);
- void Client_AddPlayerToList(string playername, NetworkPlayer view)
- MPPlayer tempplayer =new MPPlayer();
- tempplayer.PlayerNetwork= view;
- if(Network.player view)
- MyPlayer = tempplayer;
- GameObject play = Network.Instantiate(PlayerManagerPrefab, Vector3.zero, Quaternion.identity, 5)as GameObject;
- }
- [RPC]
- {
- foreach(MPPlayer pl in PlayerList)
- if(pl.PlayerNetwork view)
- temppl = pl;
- }
- {
- }
- void Client_GetMultiplayerMatchSettings(string map, string mode, string others)
- CurrentMap = GetMap(map);
- {
- {
- {
- break;
- }
- returnget;
- void Client_LoadMultiplayerMap(string map, int prefix)
- //Network.SetLevelPrefix(prefix);
- }
- void OnGUI()
- if(!MyPlayer.PlayerIsAlive&& IsMatchStarted)
- if(IsMatchStarted && Input.GetKey(KeyCode.Tab))
- guiManager.ScoreBoard();
- }
- [RPC]
- {
- int numberspawn = Random.Range(0, Spawnpoints.Length-1);
- networkView.RPC('Client_SpawnPlayer', RPCMode.All, player, Spawnpoints[numberspawn].transform.position+new Vector3(0, 2, 0), Spawnpoints[numberspawn].transform.rotation);
- void Client_SpawnPlayer(NetworkPlayer player, Vector3 position, Quaternion rotation)
- MultiplayerManager.GetMPPlayer(player).PlayerIsAlive=true;
- MultiplayerManager.GetMPPlayer(player).PlayerHealth=100;
- {
- MyPlayer.PlayerManager.ControllerTransform.position= position;
- MyPlayer.PlayerManager.ControllerTransform.rotation= rotation;
- MyPlayer.PlayerManager.networkView.RPC('Client_PlayerAlive', RPCMode.All);
- else
- }
- void OnLevelWasLoaded()
- if(Application.loadedLevelName CurrentMap.MapLoadName&& Network.isServer)
- MatchLoaded =true;
- Spawnpoints = GameObject.FindGameObjectsWithTag('spawnpoint');
- networkView.RPC('Client_ServerLoaded', RPCMode.AllBuffered, IsMatchStarted);
- }
- [RPC]
- {
- IsMatchStarted = started;
- publicstatic MPPlayer GetMPPlayer(NetworkPlayer player)
- foreach(MPPlayer play in MultiplayerManager.instance.PlayerList)
- if(play.PlayerNetwork player)
- return play;
- }
- }
- //Deathmatch
- {
- if(GUI.Button(new Rect(5, Screen.height-40, 250, 35), 'Spawn'))
- if(Network.isServer)
- else
- networkView.RPC('Server_SpawnPlayer', RPCMode.Server, Network.player);
- }
- [RPC]
- publicvoid Client_UpdatePlayerHealthAndAlive(NetworkPlayer targetplayer, bool IsAlive, int CurrentHealth)
- MPPlayer player = MultiplayerManager.GetMPPlayer(targetplayer);
- player.PlayerHealth= CurrentHealth;
- }
- [System.Serializable]
- {
- public NetworkPlayer PlayerNetwork;
- publicint PlayerHealth =100;
- publicint PlayerScore;
- publicint PlayerDeahts;
- publicclass MapSetting
- publicstring MapName;
- public Texture MapLoadTexture;
Network Player 2.1 Windows 7
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.