Updated aim
This commit is contained in:
@ -53,36 +53,9 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (itemSelector == null)
|
||||
{
|
||||
itemSelector = ItemSelector.instance;
|
||||
}
|
||||
|
||||
|
||||
if (useItemSelector)
|
||||
{
|
||||
|
||||
InteractableItem item = this.itemSelector.Selected;
|
||||
if(item != null)
|
||||
{
|
||||
if (item is HeavyInteractableItem)
|
||||
{
|
||||
heavyItemsInRange = new List<HeavyInteractableItem>() { (HeavyInteractableItem)item };
|
||||
itemsInRange = new List<InteractableItem> { item };
|
||||
print("Item:" + item.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
itemsInRange = new List<InteractableItem> { item };
|
||||
heavyItemsInRange = new List<HeavyInteractableItem>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
itemsInRange = new List<InteractableItem>();
|
||||
heavyItemsInRange = new List<HeavyInteractableItem>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(Input.GetButtonDown("Fire1"))
|
||||
{
|
||||
if (this.GunEnabled)
|
||||
@ -218,7 +191,7 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
/* if(other.gameObject.GetComponent<InteractableItem>() != null)
|
||||
if(other.gameObject.GetComponent<InteractableItem>() != null)
|
||||
{
|
||||
InteractableItem item = other.gameObject.GetComponent<InteractableItem>();
|
||||
if(item is InteractableItem && item is not HeavyInteractableItem)
|
||||
@ -231,11 +204,11 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
heavyItemsInRange.Add((HeavyInteractableItem)item);
|
||||
}
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
/*if (other.gameObject.GetComponent<InteractableItem>() != null)
|
||||
if (other.gameObject.GetComponent<InteractableItem>() != null)
|
||||
{
|
||||
InteractableItem item = other.gameObject.GetComponent<InteractableItem>();
|
||||
if (item is InteractableItem && item is not HeavyInteractableItem)
|
||||
@ -250,6 +223,6 @@ public class PlayerInteractionHandler : MonoBehaviour
|
||||
//itemsInRange.Remove((HeavyInteractableItem)(item));
|
||||
heavyItemsInRange.Remove((HeavyInteractableItem)item);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user