/// <summary> /// Add a StartTouchingEventComp to activate the other systems /// </summary> /// <param name="hasTouchInteraction"></param> /// <param name="baseInput"></param> /// <param name="entity"></param> /// <param name="simulatedButton"></param> private void AddStartTouchingComp(bool hasTouchInteraction, ref BaseInputCapture baseInput, ref Entity entity, EControllersButton simulatedButton) { if (hasTouchInteraction) { EntityManager.AddComponentData(entity, new StartTouchingEventComp { HasWaitedOneFrameBeforeRemoval = false, ButtonInteracting = simulatedButton }); baseInput.IsTouching = true; } }
/// <summary> /// Add a StartClickingEventComp to activate the other systems /// </summary> /// <param name="hasClickInteraction"></param> /// <param name="baseInput"></param> /// <param name="entity"></param> /// <param name="simulatedButton"></param> private void AddStartClickingComp(bool hasClickInteraction, ref BaseInputCapture baseInput, ref Entity entity, EControllersButton simulatedButton) { // if the VRInteractionAuthoring has a Click Interaction set in editor if (hasClickInteraction) { EntityManager.AddComponentData(entity, new StartClickingEventComp { HasWaitedOneFrameBeforeRemoval = false, ButtonInteracting = simulatedButton }); baseInput.IsClicking = true; } }
public static bool IsNotInteractingTouchpad(BaseInputCapture bic, ControllersInteractionType cit, InteractionThumbPosition itp, TouchpadInputCapture tic, bool checkingYAxis = false, bool checkingXAxis = true) { if (cit.HasClickInteraction) { return(!bic.IsClicking || (checkingYAxis && Math.Abs(tic.ThumbPosition.y) < itp.IsClickingThreshold) || (checkingXAxis && Math.Abs(tic.ThumbPosition.x) < itp.IsClickingThreshold)); } if (cit.HasTouchInteraction) { return(!bic.IsTouching || (checkingYAxis && Math.Abs(tic.ThumbPosition.y) < itp.IsTouchingThreshold) || (checkingXAxis && Math.Abs(tic.ThumbPosition.x) < itp.IsTouchingThreshold)); } return(false); }
public static bool IsInteracting(BaseInputCapture bic, ControllersInteractionType cit) { return((cit.HasClickInteraction && bic.IsClicking) || (cit.HasTouchInteraction && bic.IsTouching)); }