void OnExit(Rigidbody rb, bool isSpecial) { InteractableRef interactableRef = rb.GetComponent <InteractableRef>(); if (!interactableRef) { return; } InteractionModel interaction = model.interactions.Find(x => x.interactable == interactableRef.interactable); if (interaction != null) { if (interaction.totalTouchCount == 1) { Touch(interaction, false); } if (interaction.totalTouchCount > 0) { interaction.totalTouchCount--; } if (interaction.specialTouchCount > 0 && isSpecial) { interaction.specialTouchCount--; } } }
void OnEnter(Rigidbody rb, bool isSpecial) { InteractableRef interactableRef = rb.GetComponent <InteractableRef>(); if (!interactableRef) { return; } InteractionModel interaction = model.interactions.Find(x => x.interactable == interactableRef.interactable); if (interaction != null) { if (interaction.totalTouchCount == 0) { Touch(interaction, true); } interaction.totalTouchCount++; if (isSpecial) { interaction.specialTouchCount++; } } }
void OnExit_Hover(Rigidbody rb) { InteractableRef interactableRef = rb.GetComponent <InteractableRef>(); if (!interactableRef) { return; } InteractionModel interaction = model.interactions.Find(x => x.interactable == interactableRef.interactable); if (interaction != null) { Hover(interaction, false); // Update() will .Remove unhovered interactions after calling EventWaterfall() } }
void OnEnter_Hover(Rigidbody rb) { InteractableRef interactableRef = rb.GetComponent <InteractableRef>(); if (!interactableRef) { return; } InteractionModel interaction = model.interactions.Find(x => x.interactable == interactableRef.interactable); if (interaction == null) { interaction = new InteractionModel(); interaction.interactable = interactableRef.interactable; interaction.interactor = this; model.interactions.Add(interaction); Hover(interaction, true); } }