private void DisableCollisionWithPlayer(Collider mc)
    {
        List <Collider> list         = new List <Collider>(3);
        Item            currentItem  = Player.Get().GetCurrentItem(Hand.Left);
        Item            currentItem2 = Player.Get().GetCurrentItem(Hand.Right);

        if (currentItem)
        {
            list.Clear();
            currentItem.gameObject.GetComponents <Collider>(list);
            if (list.Count > 0)
            {
                Physics.IgnoreCollision(mc, list[0]);
            }
        }
        if (currentItem2)
        {
            list.Clear();
            currentItem2.gameObject.GetComponents <Collider>(list);
            if (list.Count > 0)
            {
                Physics.IgnoreCollision(mc, list[0]);
            }
        }
        Physics.IgnoreCollision(mc, Player.Get().m_Collider);
        for (int i = 0; i < ReplicatedLogicalPlayer.s_AllLogicalPlayers.Count; i++)
        {
            ReplicatedLogicalPlayer replicatedLogicalPlayer = ReplicatedLogicalPlayer.s_AllLogicalPlayers[i];
            Collider collider = (replicatedLogicalPlayer != null) ? replicatedLogicalPlayer.GetComponent <Collider>() : null;
            if (collider != null)
            {
                Physics.IgnoreCollision(mc, collider);
            }
        }
    }
Пример #2
0
    public static GameObject GetLocalReplicatedPlayer()
    {
        ReplicatedLogicalPlayer s_LocalLogicalPlayer = ReplicatedLogicalPlayer.s_LocalLogicalPlayer;

        if (s_LocalLogicalPlayer == null)
        {
            return(null);
        }
        return(s_LocalLogicalPlayer.gameObject);
    }
Пример #3
0
 public static void ForEachLogicalPlayer(Action <ReplicatedLogicalPlayer> action, ReplTools.EPeerType enum_method = ReplTools.EPeerType.All)
 {
     for (int i = 0; i < ReplicatedLogicalPlayer.s_AllLogicalPlayers.Count; i++)
     {
         ReplicatedLogicalPlayer replicatedLogicalPlayer = ReplicatedLogicalPlayer.s_AllLogicalPlayers[i];
         if (!(replicatedLogicalPlayer == null) && (enum_method != ReplTools.EPeerType.Remote || !(replicatedLogicalPlayer == ReplicatedLogicalPlayer.s_LocalLogicalPlayer)) && (enum_method != ReplTools.EPeerType.Local || !(replicatedLogicalPlayer != ReplicatedLogicalPlayer.s_LocalLogicalPlayer)))
         {
             action(replicatedLogicalPlayer);
         }
     }
 }