예제 #1
0
    public virtual void SetupCorpse(BaseCorpse corpse)
    {
        corpse.flags = flags;
        LootableCorpse component = corpse.GetComponent <LootableCorpse>();

        if ((bool)component)
        {
            component.TakeFrom(inventory);
        }
    }
예제 #2
0
        private void OnPlayerCorpseSpawned(BasePlayer player, BaseCorpse corpse)
        {
            if (!_lastDroppedBackpacks.ContainsKey(player.userID))
            {
                return;
            }

            var container = _lastDroppedBackpacks[player.userID];

            if (container == null)
            {
                return;
            }

            var corpseCollider    = corpse.GetComponent <Collider>();
            var containerCollider = _lastDroppedBackpacks[player.userID].GetComponent <Collider>();

            if (corpseCollider != null && containerCollider != null)
            {
                Physics.IgnoreCollision(corpseCollider, containerCollider);
            }

            _lastDroppedBackpacks.Remove(player.userID);
        }