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


C# NetworkPlayer.GetHashCode方法代码示例

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


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

示例1: RPCSetUserView

    private void RPCSetUserView(NetworkPlayer nwid, string nick, int uid, string photo, int tk, int td, int tzk, int tzd)
    {

        CallRPC(true, localuser.nwid, localuser.nick, localuser.uid, localuser.photo, tk, td, tzk, tzd);
        if (nwid == Network.player) return;

        Vk.user user = new Vk.user();
        user.nick = nick;
        user.uid = uid;
        user.photo = photo;
        user.nwid = nwid;
        user.totalkills = tk;
        user.totaldeaths = td;
        user.totalzombiekills = tzk;
        user.totalzombiedeaths = tzd;

        if (photo != "")
            new WWW2(photo).done += delegate(WWW2 www)
            {
                print("loaded texture");
                user.texture = www.texture;
                DontDestroyOnLoad(user.texture);
            };
        userviews.Add(nwid.GetHashCode(), user);

    }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:26,代码来源:ConsoleWindow.cs

示例2: OnPlayerDisconnected

    void OnPlayerDisconnected(NetworkPlayer player2)
    {
        int player = player2.GetHashCode();
        players[player].Destroy();
        foreach (box a in GameObject.FindObjectsOfType(typeof(box)))
        {
            if (a.id == player)
                a.RPCResetOwner();

            foreach (NetworkView v in a.GetComponents<NetworkView>())
                if (v.owner.GetHashCode() == player) Destroy(v.viewID);
        }
        Network.DestroyPlayerObjects(player2);
        Network.RemoveRPCs(player2);
    }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:15,代码来源:z4Game.cs

示例3: OnPlayerDisconnected

 public void OnPlayerDisconnected(NetworkPlayer player)
 {                
     CallRPC(RemovePlayerView, RPCMode.All, player.GetHashCode());
     Network.RemoveRPCs(player);
     Network.DestroyPlayerObjects(player);
 }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:6,代码来源:Game.cs

示例4: OnPlayerDisconnected

 private void OnPlayerDisconnected(NetworkPlayer player) {
     Debug.Log("Player disconnected: " + player.GetHashCode());
     Network.RemoveRPCs(player);
     Network.DestroyPlayerObjects(player);
 }
开发者ID:mbhuet,项目名称:MastersProject,代码行数:5,代码来源:BluetoothMultiplayerDemoGui.cs

示例5: OnPlayerDisconnected

    void OnPlayerDisconnected(NetworkPlayer player) //destroy
    {
        int playerid = player.GetHashCode();
        RPCWriteMessage(players[playerid].nick + " Disconnected");
        foreach (Box box in GameObject.FindObjectsOfType(typeof(Box)))
            //if (!(box is Player))
            {
                if (box.selected == playerid)
                    box.RPCResetOwner();

                foreach (NetworkView nw in box.GetComponents<NetworkView>())
                    if (nw.owner.GetHashCode() == playerid) RPCDestroy(nw.viewID);
            }

        Network.DestroyPlayerObjects(player);
        Network.RemoveRPCs(player);
    }
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:17,代码来源:Game.cs


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