1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Interactions;
|
||||
namespace BITKit.Entities
|
||||
namespace BITKit.Entities.Player
|
||||
{
|
||||
public class EntityInteractive : EntityPlayerComponent
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace BITKit.Entities
|
||||
private IntervalUpdate cd = new(0.08f);
|
||||
public override void OnUpdate(float deltaTime)
|
||||
{
|
||||
if (Physics.Raycast(cameraTransform.position,cameraTransform.forward, out var raycastHit, distance, layerMask))
|
||||
if (Physics.Raycast(cameraTransform.position,cameraTransform.forward, out var raycastHit, distance, layerMask,QueryTriggerInteraction.Collide))
|
||||
{
|
||||
if (raycastHit.transform.TryGetComponentAny<ISelectable>(out var _detected))
|
||||
{
|
||||
@@ -68,7 +68,7 @@ namespace BITKit.Entities
|
||||
}
|
||||
public void Interactive(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.interaction is not TapInteraction || !context.performed) return;
|
||||
if (context.interaction is not PressInteraction || !context.performed) return;
|
||||
var _selected = selected;
|
||||
if (_selected is not MonoBehaviour monoBehaviour) return;
|
||||
if (monoBehaviour.TryGetComponentAny<IAction>(out var action))
|
||||
|
Reference in New Issue
Block a user