本文整理匯總了C#中ClientInfo.setNum方法的典型用法代碼示例。如果您正苦於以下問題:C# ClientInfo.setNum方法的具體用法?C# ClientInfo.setNum怎麽用?C# ClientInfo.setNum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ClientInfo
的用法示例。
在下文中一共展示了ClientInfo.setNum方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: clientInfoIsReady
public void clientInfoIsReady(string login, ClientInfo c)
{
if (Network.isServer) {
this.positionsClients[login] = this.countClients;
}
Debug.LogError("[NETWORK MANAGER] clientInfoIsReady: <" + login + "> was created at position <" + this.positionsClients[login] + ">");
c.transform.Translate(this.playerSpawn);
c.setNum(this.positionsClients[login]);
if (WorldInfo.listOfPlayers == null) {
Debug.LogError ("[NETWORK MANAGER] clientInfoIsReady: listOfPlayer is null, creating...");
WorldInfo.listOfPlayers = new List<string>();
}
WorldInfo.listOfPlayers.Add(login);
this.countClients++;
int nbPlayers = this.countClients;
Debug.LogError(WorldInfo.countNetworkConnection + " == " + nbPlayers);
if (WorldInfo.countNetworkConnection == nbPlayers) {
if (!Network.isServer) {
Debug.LogError("[NETWORK MANAGER] clientInfoIsReady: PLAYERS LOGINS ARE DISPACHED, SEND TO SERVER THAT I'M READY");
this.nV.RPC("clientIsReady", RPCMode.Server, WorldInfo.login);
return;
} else {
Debug.LogError("[NETWORK MANAGER] clientInfoIsReady: SERVER IS READY, DISPATCHING TO OTHER ALL PLAYER LOGINS [SERVER]");
//this.clients[WorldInfo.login].setState("client ready confirmed");
string[] logins = new string[this.countClients];
string[] positions = new string[this.countClients];
for (int i = 0; i < this.countClients; ++i) {
logins[i] = WorldInfo.listOfPlayers[i];
positions[i] = this.positionsClients[WorldInfo.listOfPlayers[i]].ToString();
}
this.nV.RPC("serverIsReady", RPCMode.Others, string.Join(":", logins), string.Join(":", positions));
}
}
}