当前位置: 首页>>代码示例>>C#>>正文


C# Photon.Hashtable类代码示例

本文整理汇总了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);
    }
开发者ID:gamkedo-la,项目名称:Foam_Corps,代码行数:26,代码来源:PlayerStats.cs

示例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);
    }
开发者ID:SaltPeter,项目名称:fps,代码行数:33,代码来源:bl_SettingPropiertis.cs

示例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.
    }
开发者ID:RoyKirk,项目名称:AIEWork,代码行数:7,代码来源:PunPlayerScores.cs

示例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.
	}
开发者ID:umjinsun12,项目名称:Suddenforce,代码行数:7,代码来源:PlayerKill.cs

示例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 );
	}
开发者ID:EvilAbyss,项目名称:Wulfram,代码行数:12,代码来源:GamemodeBase.cs

示例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;
        }
开发者ID:Barnaff,项目名称:NetherWars2,代码行数:25,代码来源:NWGameSetupDataObject.cs

示例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();
    }
开发者ID:Pecke123,项目名称:Genesis_Unknown,代码行数:27,代码来源:ScoreBoard.cs

示例8: Encode

 public Hashtable Encode()
 {
     Hashtable hash = new Hashtable();
     hash.Add((int)eServerActionKey.ActionType, ActionType);
     hash.Add((int)eServerActionKey.ActionParams, ActionsParams);
     return hash;
 }
开发者ID:Barnaff,项目名称:NetherWars2,代码行数:7,代码来源:NWServerAction.cs

示例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();
        }
开发者ID:JohnnyVox,项目名称:schoolfire,代码行数:30,代码来源:PhotonNetworkCreateRoomAdvanced.cs

示例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;
 }
开发者ID:Barnaff,项目名称:NetherWars2,代码行数:8,代码来源:NWZoneDataObject.cs

示例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);
     }
 }
开发者ID:danieljustice,项目名称:Dino-Byte,代码行数:8,代码来源:TimerScript.cs

示例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);
    }
开发者ID:kagechika,项目名称:PhotonWorkShop,代码行数:11,代码来源:PhotonPlayer.cs

示例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);
 }
开发者ID:jdohgamer,项目名称:SSC,代码行数:9,代码来源:PlayerAction.cs

示例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"]);
	}
开发者ID:KingCrazy,项目名称:cubeShooter,代码行数:9,代码来源:ConnectToRoom.cs

示例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;
 }
开发者ID:kwahu,项目名称:polcongame,代码行数:9,代码来源:MainMenu.cs


注:本文中的ExitGames.Client.Photon.Hashtable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。