Hello guys i have problem
please help
Assets/Scripts/MultiplayerManager.cs(68,39): error CS0103: The name `View’ does not exist in the current context
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MultiplayerManager : MonoBehaviour
{
public static MultiplayerManager instance;
public string PlayerName;
private string MatchName = "";
private string MatchPassword = "";
private int MatchMaxUsers = 32;
public List<MPPlayer> PlayerList = new List<MPPlayer>();
void Start()
{
instance = this;
}
public void StartServer(string servername, string serverpassword, int maxusers)
{
MatchName = servername;
MatchPassword = serverpassword;
MatchMaxUsers = maxusers;
Network.InitializeServer (MatchMaxUsers, 2550, false);
Network.InitializeSecurity();
}
void OnServerInitialized()
{
Server_PlayerJoinRequest("", Network.player);
}
void OnConncetedToServer()
{
networkView.RPC("Server_PlayerJoinRequest", RPCMode.Server, "", Network.player);
}
void OnPlayerDisconnected(NetworkPlayer id)
{
networkView.RPC("Client_RemovePlayer", RPCMode.All, id);
}
[RPC]
void Server_PlayerJoinRequest(string playername, NetworkPlayer View)
{
networkView.RPC("Client_AddPlayerToList", RPCMode.All, playername, View);
}
[RPC]
void Client_AddPlayerToList(string playername, NetworkPlayer View)
{
MPPlayer tempplayer = new MPPlayer();
tempplayer.Playername = playername;
tempplayer.PlayerNetwork = View;
PlayerList.Add (tempplayer);
}
[RPC]
void Client_RemovePlayer()
{
MPPlayer temppl = null;
foreach(MPPlayer pl in PlayerList)
{
if(pl.PlayerNetwork = View)
{
temppl = pl;
}
}
if(temppl != null)
{
PlayerList.Remove(temppl);
}
}
}
public class MPPlayer
{
public string Playername = "";
public NetworkPlayer PlayerNetwork;
}