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


C# ExitGames.Client.Photon.Hashtable.StripToStringKeys方法代码示例

本文整理汇总了C#中ExitGames.Client.Photon.Hashtable.StripToStringKeys方法的典型用法代码示例。如果您正苦于以下问题:C# ExitGames.Client.Photon.Hashtable.StripToStringKeys方法的具体用法?C# ExitGames.Client.Photon.Hashtable.StripToStringKeys怎么用?C# ExitGames.Client.Photon.Hashtable.StripToStringKeys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExitGames.Client.Photon.Hashtable的用法示例。


在下文中一共展示了ExitGames.Client.Photon.Hashtable.StripToStringKeys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetCustomProperties

    /// <summary>
    /// Updates and synchronizes the named properties of this Player with the values of propertiesToSet.
    /// </summary>
    /// <remarks>
    /// Any player's properties are available in a Room only and only until the player disconnect or leaves.
    /// Access any player's properties by: Player.CustomProperties (read-only!) but don't modify that hashtable.
    ///
    /// New properties are added, existing values are updated.
    /// Other values will not be changed, so only provide values that changed or are new.
    /// To delete a named (custom) property of this player, use null as value.
    /// Only string-typed keys are applied (everything else is ignored).
    ///
    /// Local cache is updated immediately, other players are updated through Photon with a fitting operation.
    /// To reduce network traffic, set only values that actually changed.
    /// </remarks>
    /// <param name="propertiesToSet">Hashtable of props to udpate, set and sync. See description.</param>
    public void SetCustomProperties(Hashtable propertiesToSet)
    {
        if (propertiesToSet == null)
        {
            return;
        }

        // merge (delete null-values)
        this.customProperties.MergeStringKeys(propertiesToSet); // includes a Equals check (simplifying things)
        this.customProperties.StripKeysWithNullValues();

        // send (sync) these new values
        Hashtable customProps = propertiesToSet.StripToStringKeys() as Hashtable;
        if (this.actorID > 0 && !PhotonNetwork.offlineMode)
        {
            PhotonNetwork.networkingPeer.OpSetCustomPropertiesOfActor(this.actorID, customProps, true, 0);
        }
        NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnPhotonPlayerPropertiesChanged, this, propertiesToSet);
    }
开发者ID:AsifAhmed16,项目名称:Operation-Hatirjheel,代码行数:35,代码来源:PhotonPlayer.cs


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