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


C# Networking.NetworkInstanceId类代码示例

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


NetworkInstanceId类属于UnityEngine.Networking命名空间,在下文中一共展示了NetworkInstanceId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddItem

        /// <summary>
        /// Attribue un item à un slot déjà existant
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        /// <param name="spritePath"></param>
        public static void AddItem(Item itemToAdd, NetworkInstanceId _go)
        {
            itemToAdd.go = _go;
            int slotId = 0;
            InventorySlot currentSlot;

            // Initialisation du numéro de slot à remplir
            while (slotId < slots.Count())
            {
                if (slotId >= SLOTS_NBR)
                {
                    return;
                }

                currentSlot = slots[slotId];
                if (currentSlot.IsEmpty)
                    break;
                else if (currentSlot.Item.Name.Equals(itemToAdd.Name) && currentSlot.Amount < 100)
                {
                    currentSlot.Amount += 1;       // Si un ojet du même type a été trouvé, on incrémente juste la quantité
                    return;
                }
                slotId++;
            }
            slots[slotId].FillSlot(itemToAdd);
        }
开发者ID:CalvoR,项目名称:2016_3A_Unity_Calvo_GodVSMan,代码行数:32,代码来源:Inventory.cs

示例2: RpcSetWeaponTarget

    void RpcSetWeaponTarget(NetworkInstanceId target)
    {
        //Prende la transform del veicolo per settare la mira correttamente.  Trovare un altro sistema!!!

        targetIk.solver.target = ClientScene.FindLocalObject(target).transform.GetComponent<ControllerWheels>().CentralPoint.transform;

    }
开发者ID:Alx666,项目名称:ProjectPhoenix,代码行数:7,代码来源:IKControllerHumanoid.cs

示例3: PlayerInfoPacket

 public PlayerInfoPacket(string name, string team, NetworkInstanceId networkID, int score = 0)
 {
     this.playerName = name;
     this.playerTeam = team;
     this.networkID = networkID;
     this.score = score;
 }
开发者ID:gcoope,项目名称:HeroesAndVillains,代码行数:7,代码来源:PlayerInfoPacket.cs

示例4: StopDragging

    public void StopDragging(NetworkInstanceId netId)
    {
        //draggingHelper = playerTransform.GetComponent<DraggingHelper>();

        //draggingHelper.CmdSetDraggedBody(netId);
        StopDragging();
    }
开发者ID:cristi16,项目名称:Artefacts---Collaborative-evolution-of-three-dimensional-objects,代码行数:7,代码来源:Dragable.cs

示例5: CmdAddDeath

 public void CmdAddDeath(NetworkInstanceId attacker)
 {
     deaths++;
     var attackerObj = ClientScene.FindLocalObject(attacker);
     if (attackerObj) {
         attackerObj.GetComponent<Player>().kills++;
     }
 }
开发者ID:raftelti,项目名称:flamewars,代码行数:8,代码来源:Player.cs

示例6: CmdUnspawnUnit

 public void CmdUnspawnUnit(NetworkInstanceId objID)
 {
     GameObject unspawnedObj = NetworkServer.FindLocalObject(objID);
     //NetworkServer.UnSpawn(unspawnedObj);
     NetworkServer.Destroy(unspawnedObj);
     //For the server we don't want to see it, but it will stil exists, because we need the reference to the old object due to buttons listeners.
     unspawnedObj.GetComponent<MeshRenderer>().enabled = false;
 }
开发者ID:cristinaNiculescu,项目名称:towerBattle,代码行数:8,代码来源:UnitConstruction.cs

示例7: registerKill

 public void registerKill(NetworkInstanceId netId, int playerKilledId, int playerKillerId)
 {
     KillPlayer kp = new KillPlayer();
     kp.netId = netId;
     nm.client.Send(Msgs.killPlayer, kp);
     pom.killPlayerLocal(playerKilledId, playerKillerId);
     Debug.Log("Player " + playerKilledId + " died");
 }
开发者ID:Geor23,项目名称:Planets,代码行数:8,代码来源:RoundEvents.cs

示例8: RpcPickUp

 void RpcPickUp(NetworkInstanceId id)
 {
     if (pc == null)
         pc = ClientScene.FindLocalObject (id).GetComponent<PlayerControls> ();
     GetComponent<SpriteRenderer> ().enabled = false;
     GetComponent<CircleCollider2D> ().enabled = false;
     if (pc.isLocalPlayer)
         MainGUI.GUI.SetPowerUpIcon (Icon);
 }
开发者ID:tylerbonnell,项目名称:Platformer-Bullet-Hell,代码行数:9,代码来源:GhostMode.cs

示例9: LogKill

    // Logs deaths in the scoreboard and kills where applicable
    public static void LogKill(NetworkInstanceId killerId, NetworkInstanceId victimId)
    {
        PlayerStats[victimId]["deaths"]++;

        // Not a suicide or environmental death, so log a kill
        if (!killerId.IsEmpty () && killerId != victimId) {
            PlayerStats[killerId]["kills"]++;
        }
    }
开发者ID:tylerbonnell,项目名称:Platformer-Bullet-Hell,代码行数:10,代码来源:GameManager.cs

示例10: Reset

 public void Reset()
 {
     Life = MAX_PLAYER_LIFE;
     ExplosionRange = MIN_EXPLOSION_RANGE;
     MaxBombsNum = MIN_BOMB_NUM;
     Speed = MIN_SPEED * 2;
     NetId = NetworkInstanceId.Invalid;
     KickSkill = false;
 }
开发者ID:MasakiWang,项目名称:Team-Trainning-2015-08,代码行数:9,代码来源:PlayerData.cs

示例11: CmdShoot

 private void CmdShoot(NetworkInstanceId id, bool explosion)
 {
     GameObject player = NetworkServer.FindLocalObject(id);
     var healthScript = player.GetComponent<NetworkHealth>();
     if(healthScript == null) {
         Debug.LogError("no healthScripts attached to player");
         return;
     }
     healthScript.TakeDamage(damage, explosion);
 }
开发者ID:cwp10,项目名称:MyFPSGameProject,代码行数:10,代码来源:Grenade.cs

示例12: GetNetworkIdentity

 internal bool GetNetworkIdentity(NetworkInstanceId netId, out NetworkIdentity uv)
 {
     if (this.m_LocalObjects.ContainsKey(netId) && (this.m_LocalObjects[netId] != null))
     {
         uv = this.m_LocalObjects[netId];
         return true;
     }
     uv = null;
     return false;
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:10,代码来源:NetworkScene.cs

示例13: CmdEquipItem

 public void CmdEquipItem(NetworkInstanceId netId, int handIndex)
 {
     var go = NetworkServer.FindLocalObject(netId);
     go.transform.SetParent(handIndex == -1 ? playerLeftHand : playerRightHand);
     go.transform.position = Vector3.zero;
     go.transform.localPosition = Vector3.zero;
     go.transform.rotation = Quaternion.identity;
     go.SetActive(true);
     RpcEquipItem(netId, handIndex);
 }
开发者ID:CalvoR,项目名称:2016_3A_Unity_Calvo_GodVSMan,代码行数:10,代码来源:gvmPlayerControler.cs

示例14: FindLocalObject

 internal GameObject FindLocalObject(NetworkInstanceId netId)
 {
   if (this.m_LocalObjects.ContainsKey(netId))
   {
     NetworkIdentity localObject = this.m_LocalObjects[netId];
     if ((Object) localObject != (Object) null)
       return localObject.gameObject;
   }
   return (GameObject) null;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:10,代码来源:NetworkScene.cs

示例15: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.netId = reader.ReadNetworkId();
     this.payload = reader.ReadBytesAndSize();
     this.teleport = reader.ReadBoolean();
     this.time = (int) reader.ReadPackedUInt32();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:OverrideTransformMessage.cs


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