private void ToggleInventory() { UIManager.Instance.Notify(UIRequest.HUD, UIRequestMode.Toggle); UIManager.Instance.Notify(UIRequest.Inventory, UIRequestMode.Toggle, InventoryType.PLAYER, inventory, equipement); interractibleObject = null; UIManager.Instance.Notify(UIRequest.InterractionFeedback, UIRequestMode.Hide); }
public void Interract() { if (interractibleObject != null) { interractibleObject.Use(); interractibleObject = null; UIManager.Instance.Notify(UIRequest.InterractionFeedback, UIRequestMode.Hide); } }
private void LookForInterraction() { RaycastHit raycast; if (Physics.Raycast(camera.transform.position, camera.transform.forward, out raycast, 2.5f)) { IInterract iInterract = raycast.collider.GetComponent <IInterract>(); if (iInterract != null && iInterract.CanInterract()) { UIManager.Instance.Notify(UIRequest.InterractionFeedback, UIRequestMode.Show, iInterract.InterractionDescription()); interractibleObject = raycast.transform.GetComponent <IInterract>(); return; } } if (interractibleObject != null) { UIManager.Instance.Notify(UIRequest.InterractionFeedback, UIRequestMode.Hide); } interractibleObject = null; }