resource limits added
This commit is contained in:
@ -12,6 +12,7 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
private List<InteractableItem> itemsInRange= new List<InteractableItem>();
|
||||
private List<HeavyInteractableItem> heavyItemsInRange = new List<HeavyInteractableItem>();
|
||||
private Inventory invent;
|
||||
private TempInventory tempInvent;
|
||||
public Inventory Inventory { get { return invent; } }
|
||||
public static PlayerInteractionHandler instance;
|
||||
[SerializeField]
|
||||
@ -30,6 +31,7 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
private bool gunEnabled = false;
|
||||
[SerializeField]
|
||||
private Transform carryingPos;
|
||||
public Transform CarryingPos { get { return this.carryingPos; } }
|
||||
|
||||
private ItemSelector itemSelector;
|
||||
[SerializeField]
|
||||
@ -43,6 +45,9 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
{
|
||||
instance = this;
|
||||
invent = this.transform.parent.GetComponent<Inventory>();
|
||||
//TEMP FIELD
|
||||
tempInvent = this.transform.parent.GetComponent<TempInventory>();
|
||||
|
||||
initColor = flashlight3D.GetComponent<MeshRenderer>().materials[materialIndex].GetColor("_BaseColor");
|
||||
selMaterial = flashlight3D.GetComponent<MeshRenderer>().materials[materialIndex];
|
||||
itemSelector = ItemSelector.instance;
|
||||
@ -75,7 +80,12 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
{
|
||||
if (this.GunEnabled)
|
||||
{
|
||||
this.pistol.Fire();
|
||||
if (tempInvent.GetQuantityOf(this.pistol.projectileName) > 0)
|
||||
{
|
||||
this.pistol.Fire();
|
||||
tempInvent.Remove(this.pistol.projectileName);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user