Exemplo n.º 1
0
        private void TakeObject(int lootTrackerId, int slotIndex, int senderId)
        {
            var playerObject = LootSpawnerScript.GetLootTracker()[lootTrackerId];

            if (playerObject.IsAvailable())
            {
                playerObject.SetAvailable(false);
                playerObject.Hide();
            }

            //several player tried to loot the object at the same time, only the first one should see it in its inventory
            else
            {
                if (playerID == senderId)
                {
                    playerInventory.CancelCollect(lootTrackerId);
                }
            }

            //object is no longer in looting mode
            playerObject.SetLooting(false);
        }
Exemplo n.º 2
0
 private void DropObject(int lootTrackerId, Vector3 position)
 {
     LootSpawnerScript.GetLootTracker()[lootTrackerId].Drop(position);
 }
Exemplo n.º 3
0
 private void UpdateWeapon(int lootTrackerId, float ammoCount)
 {
     LootSpawnerScript.GetLootTracker()[lootTrackerId].GetWeapon().SetCurrentAmmo(ammoCount);
 }