本文整理汇总了C#中ExitGames.Client.Photon.Hashtable类的典型用法代码示例。如果您正苦于以下问题:C# ExitGames.Client.Photon.Hashtable类的具体用法?C# ExitGames.Client.Photon.Hashtable怎么用?C# ExitGames.Client.Photon.Hashtable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExitGames.Client.Photon.Hashtable类属于命名空间,在下文中一共展示了ExitGames.Client.Photon.Hashtable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddScore_RPC
void AddScore_RPC(string fragger, string fragged)
{
//If I'm the killer, add to my frags, call AddMessage and say how many opponents I've defeated
if(fragger == playerMe)
{
PhotonHashtable PlayerCustomProps = new PhotonHashtable();
PlayerCustomProps["kills"] = ((playerFrag + 1).ToString());
PhotonNetwork.player.SetCustomProperties(PlayerCustomProps);
playerFrag = (float.Parse(PlayerCustomProps["kills"].ToString()));
AddMessage (fragger + " has defeated " + playerFrag + " opponents.");
}
if(fragged == playerMe)
{
PhotonHashtable PlayerCustomProps = new PhotonHashtable();
PlayerCustomProps["Deaths"] = ((playerDeath + 1).ToString());
PhotonNetwork.player.SetCustomProperties(PlayerCustomProps);
playerDeath = (float.Parse(PlayerCustomProps["Deaths"].ToString()));
AddMessage (fragged + " has perished " + playerDeath + " times.");
}
scoreManager.ChangeScore(fragger, "kills", 1);
scoreManager.ChangeScore(fragged, "deaths", 1);
}
示例2: SettingPropiertis
public void SettingPropiertis()
{
//Initialize new properties where the information will stay Room
if (PhotonNetwork.isMasterClient) {
Hashtable setTeamScore = new Hashtable();
setTeamScore.Add(PropiertiesKeys.Team1Score, 0);
PhotonNetwork.room.SetCustomProperties(setTeamScore);
Hashtable setTeam2Score = new Hashtable();
setTeam2Score.Add(PropiertiesKeys.Team2Score, 0);
PhotonNetwork.room.SetCustomProperties(setTeam2Score);
}
//Initialize new properties where the information will stay Players
Hashtable PlayerTeam = new Hashtable();
PlayerTeam.Add(PropiertiesKeys.TeamKey, Team.All.ToString());
PhotonNetwork.player.SetCustomProperties(PlayerTeam);
Hashtable PlayerKills = new Hashtable();
PlayerKills.Add(PropiertiesKeys.KillsKey, 0);
PhotonNetwork.player.SetCustomProperties(PlayerKills);
Hashtable PlayerDeaths = new Hashtable();
PlayerDeaths.Add(PropiertiesKeys.DeathsKey, 0);
PhotonNetwork.player.SetCustomProperties(PlayerDeaths);
Hashtable PlayerScore = new Hashtable();
PlayerScore.Add(PropiertiesKeys.ScoreKey, 0);
PhotonNetwork.player.SetCustomProperties(PlayerScore);
Hashtable PlayerPing = new Hashtable();
PlayerPing.Add("Ping", 0);
PhotonNetwork.player.SetCustomProperties(PlayerPing);
}
示例3: SetScore
public static void SetScore(this PhotonPlayer player, int newScore)
{
Hashtable score = new Hashtable(); // using PUN's implementation of Hashtable
score[PunPlayerScores.PlayerScoreProp] = newScore;
player.SetCustomProperties(score); // this locally sets the score and will sync it in-game asap.
}
示例4: SetKill
public static void SetKill(this PhotonPlayer player, int newKill)
{
Hashtable hkill = new Hashtable(); // using PUN's implementation of Hashtable
hkill[PlayerKill.PlayerKillProp] = newKill;
player.SetCustomProperties(hkill); // this locally sets the score and will sync it in-game asap.
}
示例5: SetRoundStartTime
/// <summary>
/// This method is storing PhotonNetwork.time in the rooms custom properties
/// Since PhotonNetwork.time is synchronized between all players, we can use this to
/// share time information between all players
/// </summary>
protected void SetRoundStartTime()
{
ExitGames.Client.Photon.Hashtable newProperties = new ExitGames.Client.Photon.Hashtable();
newProperties.Add( RoomProperty.StartTime, PhotonNetwork.time );
PhotonNetwork.room.SetCustomProperties( newProperties );
}
示例6: Encode
public override Hashtable Encode()
{
Hashtable hash = new Hashtable();
Hashtable decksHash = new Hashtable();
foreach (NWPlayerDeckDataObject deck in PlayersDecks)
{
Hashtable deckData = deck.Encode();
string playerId = deckData[ePlayerDeckDataObjectKeys.PlayerId].ToString();
decksHash.Add(playerId, (Hashtable)deckData[ePlayerDeckDataObjectKeys.DeckCards]);
}
Hashtable[] zonesHash = new Hashtable[PlayersZones.Count];
for (int i = 0; i< PlayersZones.Count; i++)
{
zonesHash[i] = PlayersZones[i].Encode();
}
hash.Add(eGameSetupKeys.Decks.ToString(), decksHash);
hash.Add(eGameSetupKeys.PlayersZones.ToString(), zonesHash);
Debug.Log( ">>>> " + Utils.HashToString(hash));
return hash;
}
示例7: TABGUI
private void TABGUI () {
ExitGames.Client.Photon.Hashtable props = new ExitGames.Client.Photon.Hashtable();
props.Add("Team", 1);
props.Add("Score", 0);
props.Add("Kills", Kills);
props.Add("death", 666);
PhotonNetwork.player.SetCustomProperties(props);
// Spieler Scores Human
foreach (PhotonPlayer player in PhotonNetwork.playerList)
{
HumanStatsCanvas.GetComponent<Text>().text = "Team: " + player.customProperties["Team"].ToString() +
" | Score: " + player.customProperties["Score"].ToString() +
" | Kills: " + player.customProperties["Kills"].ToString() +
" | Deaths: " + player.customProperties["death"].ToString() +
" | Ping: " + PhotonNetwork.networkingPeer.RoundTripTime.ToString();
}
// Spieler Scores Alien
AlienStatsCanvas.GetComponent<Text>().text = "Team: " + PhotonNetwork.player.customProperties["Team"].ToString() +
" | Score: " + PhotonNetwork.player.customProperties["Score"].ToString() +
" | Kills: " + PhotonNetwork.player.customProperties["Kills"].ToString() +
" | Deaths: " + PhotonNetwork.player.customProperties["death"].ToString() +
" | Ping: " + PhotonNetwork.networkingPeer.RoundTripTime.ToString();
}
示例8: Encode
public Hashtable Encode()
{
Hashtable hash = new Hashtable();
hash.Add((int)eServerActionKey.ActionType, ActionType);
hash.Add((int)eServerActionKey.ActionParams, ActionsParams);
return hash;
}
示例9: OnEnter
public override void OnEnter()
{
string _roomName = null;
if ( ! string.IsNullOrEmpty(roomName.Value) )
{
_roomName = roomName.Value;
}
ExitGames.Client.Photon.Hashtable _props = new ExitGames.Client.Photon.Hashtable();
int i = 0;
foreach(FsmString _prop in customPropertyKey)
{
_props[_prop.Value] = PlayMakerPhotonProxy.GetValueFromFsmVar(this.Fsm,customPropertyValue[i]);
i++;
}
string[] lobbyProps = new string[lobbyCustomProperties.Length];
int j = 0;
foreach(FsmString _visibleProp in lobbyCustomProperties)
{
lobbyProps[j] = _visibleProp.Value;
j++;
}
PhotonNetwork.CreateRoom(_roomName,isVisible.Value,isOpen.Value,maxNumberOfPLayers.Value,_props,lobbyProps);
Finish();
}
示例10: Encode
public override Hashtable Encode()
{
Hashtable hash = new Hashtable();
hash.Add((int)eZoneDataKeys.PlayerId, PlayerId);
hash.Add((int)eZoneDataKeys.ZoneType, (int)ZoneType);
hash.Add((int)eZoneDataKeys.ZoneId, ZoneId);
return hash;
}
示例11: SetGameEndTime
public void SetGameEndTime()
{
if (PhotonNetwork.isMasterClient) {
ExitGames.Client.Photon.Hashtable endTime = new ExitGames.Client.Photon.Hashtable ();
endTime.Add (RoomPropertyType.EndTime, PhotonNetwork.time + timeAfterLastCandy);
PhotonNetwork.room.SetCustomProperties (endTime);
}
}
示例12: PhotonPlayer
/// <summary>
/// Internally used to create players from event Join
/// </summary>
protected internal PhotonPlayer(bool isLocal, int actorID, Hashtable properties)
{
this.customProperties = new Hashtable();
this.isLocal = isLocal;
this.actorID = actorID;
this.InternalCacheProperties(properties);
}
示例13: GetActionFromProps
public static PlayerAction GetActionFromProps(Hashtable ht)
{
Actions act = (Actions)ht["Act"];
int iChId = (int)ht["iCharacter"];
int iChTeam = (int)ht["iCharacterTeam"];
Cell tcell = Grid_Setup.Instance.GetCellByID((int)ht["tCell"]);
Cell fcell = Grid_Setup.Instance.GetCellByID((int)ht["fCell"]);
return new PlayerAction(act,MainGame.Instance.GetCharacter(iChTeam,iChId),tcell, fcell);
}
示例14: OnPhotonRandomJoinFailed
public virtual void OnPhotonRandomJoinFailed()
{
Debug.Log("OnPhotonRandomJoinFailed() was called by PUN. No random room available, so we create one. Calling: PhotonNetwork.CreateRoom(null, new RoomOptions() {maxPlayers = 4}, null);");
Hashtable customRoomProperties = new Hashtable() { {"map", 1}, {"started", false} };
PhotonNetwork.CreateRoom(null, true, true, 6, customRoomProperties, roomPropsInLobby);
Debug.Log (customRoomProperties ["map"]);
setPlayerProperties ();
PhotonNetwork.LoadLevel ((int)customRoomProperties["map"]);
}
示例15: InitRoomSettings
PhotonHashtable InitRoomSettings()
{
//set the table with players and their charactes
customSettings = new PhotonHashtable ();
foreach (string name in playerPrefabs) {
customSettings.Add (name, false);
}
return customSettings;
}