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


C# NetworkViewID.GetGameObject方法代码示例

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


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

示例1: TryEnterVessel

 void TryEnterVessel(NetworkViewID playerViewID)
 {
     if (!rider && !playerViewID.GetGameObject().GetComponent<VesselController>())
     {
         networkView.RPC("CommitEnterVessel", RPCMode.All, playerViewID);
     }
 }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:7,代码来源:DreamVessel.cs

示例2: TryPickupItem

    void TryPickupItem(NetworkViewID playerViewID)
    {
        GameObject interactor = playerViewID.GetGameObject();
        if (interactor.GetInventory().IsFull) return;
        if (item == null)
        {
            Debug.Log("This item doesn't have a viewID yet. Assigning one.");
            item = ItemFactory.CreateItemForPlayer(this.itemName);

        }

        interactor.networkView.RPC("CommitAddToInventory", RPCMode.All, item.viewID, itemName);
        Network.Destroy(this.gameObject);
    }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:14,代码来源:WorldItem.cs

示例3: CommitEnterVessel

    void CommitEnterVessel(NetworkViewID enteringPlayer)
    {
        Debug.Log("Commit vessel entry");
        GameObject entered = enteringPlayer.GetGameObject();
        entered.transform.position = this.transform.position;
        this.transform.SetParentAndCenter(entered.transform);
        this.transform.position += Vector3.up * 1.5f;
        this.rider = entered;

        if (entered.IsMyLocalPlayer() || Network.isServer)
        {
            entered.GetComponent<ThirdPersonController>().enabled = false;
            entered.AddComponent<VesselController>().vessel = this;
        }
    }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:15,代码来源:DreamVessel.cs

示例4: NotifyDeath

    protected virtual void NotifyDeath(Vector3 deathPosition, NetworkViewID killer, int experience, int gold)
    {
        var e = new UnitDiedEventArgs() { reward = new KillReward(experience, gold), killer = killer.GetGameObject(), deathPosition = deathPosition };
        if (Died != null)
        {
            Died(gameObject, e);
        }

        killer.GetGameObject().GetCharacterStats().OnKilledUnit(new UnitKilledEventArgs() { deadUnit = this.gameObject, deathPosition = deathPosition });
    }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:10,代码来源:CharacterStats.cs

示例5: CommitPickupRelic

    void CommitPickupRelic(NetworkViewID viewID)
    {
        isPickedUp = true;
        this.collider.enabled = false;
        var player = viewID.GetGameObject();
        SetControllingTeam(player.GetTeamNumber());
        AddHolderBuffs(player);

        this.transform.SetParentAndCenter(player.transform);
        this.transform.localPosition += Vector3.up * 3.5f;
        rigidbody.isKinematic = true;

        if (Network.isServer)
        {
            player.GetCharacterStats().Died += RelicHolder_Died;
        }
    }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:17,代码来源:Relic.cs

示例6: TryPickupRelic

 void TryPickupRelic(NetworkViewID viewID)
 {
     if (!isPickedUp)
         networkView.RPC("CommitPickupRelic", RPCMode.All, viewID);
     else
         Debug.LogWarning(viewID.GetGameObject() + " tried to pick up a relic that was already picked up!");
 }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:7,代码来源:Relic.cs

示例7: TryExitVessel

    void TryExitVessel(NetworkViewID viewID)
    {
        var player = viewID.GetGameObject();

        vessel.networkView.RPC("CommitExitVessel", RPCMode.All, viewID);
        if (gameObject.IsMyLocalPlayer())
        {
            ExitVessel();
        }
        else
        {
            if (Network.isServer)
                ExitVessel();
            networkView.RPC("ExitVessel", PlayerManager.Main.FindRecord(player).networkPlayer);
        }
    }
开发者ID:BrendanMulcahy,项目名称:IronStrife,代码行数:16,代码来源:DreamVessel.cs


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