• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Photon.Hashtable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: CreateNewRoom

    //Создание комноты (+)
    public void CreateNewRoom()
    {
        ExitGames.Client.Photon.Hashtable customProps = new ExitGames.Client.Photon.Hashtable();
        customProps["MapName"] = "kaspi_map_c_2_test";
        string[] exposedProps = new string[customProps.Count];
        exposedProps[0] = "MapName";

        PhotonNetwork.CreateRoom(newRoomName, true, true, newRoomMaxPlayers, customProps, exposedProps);
    }
开发者ID:JazzyJohn,项目名称:MobaTest,代码行数:10,代码来源:ServerHolder.cs


示例17: OnJoinedRoom

    void OnJoinedRoom()
    {
        PhotonHashtable table = new PhotonHashtable(); // 변수만드는 부분
        table.Add("aimKill", aimKill);
        PhotonNetwork.room.SetCustomProperties(table);

        PhotonNetwork.isMessageQueueRunning = false;
        PhotonNetwork.LoadLevel("Field");	//씬 로딩
    }
开发者ID:gus5345,项目名称:Unity_DomainWar,代码行数:9,代码来源:CreateRoom.cs


示例18: AddDeath

	public static void AddDeath(this PhotonPlayer player, int deathToAddToCurrent)
	{
		int current = player.GetDeath();
		current = current + deathToAddToCurrent;
		
		Hashtable hdeath = new Hashtable();  // using PUN's implementation of Hashtable
		hdeath[PlayerDeath.PlayerDeathProp] = current;
		
		player.SetCustomProperties(hdeath);  // this locally sets the score and will sync it in-game asap.
	}
开发者ID:umjinsun12,项目名称:Suddenforce,代码行数:10,代码来源:PlayerDeath.cs


示例19: Start

    // Use this for initialization
	void Start () {
		
        PhotonNetwork.JoinRoom(PlayerPrefs.GetString("Room"));
        props = new ExitGames.Client.Photon.Hashtable();
        props.Add("Pseudo", pseudo);
        width = 100;
        height = 100;
        
        
    }
开发者ID:OctoPimp,项目名称:Memento-Morii,代码行数:11,代码来源:Loader.cs


示例20: PostScore

    public static void PostScore(this PhotonPlayer player, int ScoreToAdd = 0)
    {
        int current = player.GetPlayerScore();
        current = current + ScoreToAdd;

        Hashtable score = new Hashtable();  // using PUN's implementation of Hashtable
        score[PropiertiesKeys.ScoreKey] = current;

        player.SetCustomProperties(score);  // this locally sets the score and will sync it in-game asap.
    }
开发者ID:SaltPeter,项目名称:fps,代码行数:10,代码来源:PlayerPropierties.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Exp类代码示例发布时间:2022-05-24
下一篇:
C# ExifTag类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap