コード例 #1
0
ファイル: ItemSharing.cs プロジェクト: ncguy2/RoR-Sandbox
        private static void Postfix(CharacterBody body, Inventory inventory, GenericPickupController __instance)
        {
            if (!SetSharedCommand.ItemsShared)
            {
                return;
            }

            foreach (PlayerCharacterMasterController playerCharacterMasterController in PlayerCharacterMasterController
                     .instances)
            {
                if (!playerCharacterMasterController.master.alive)
                {
                    continue;
                }


                CharacterBody characterBody = playerCharacterMasterController.master.GetBody();
                if (characterBody.Equals(body))
                {
                    return;
                }

                characterBody.inventory.GiveItem(__instance.pickupIndex.itemIndex);
            }
        }