Class InteractionController
Handles the interactions, i.e. grabbing, releasing, interacting and combining of the TrainARObjects.
Inheritance
Namespace: Interaction
Assembly: Assembly-CSharp.dll
Syntax
public class InteractionController : MonoBehaviour
Fields
| Improve this Doc View SourcegrabbedObject
The object that is currently grabbed by the user.
Declaration
public GameObject grabbedObject
Field Value
Type | Description |
---|---|
GameObject | Changed when TrainAR object is grabbed/released. |
grabber
Reference to the grabber object, which becomes the parent of a picked up (grabbed) TrainAR-object.
Declaration
public GameObject grabber
Field Value
Type | Description |
---|---|
GameObject | One grabber per scene. |
hit
Raycast from the center of the screen to detected if a TrainAR object is aimed at.
Declaration
public RaycastHit hit
Field Value
Type | Description |
---|---|
RaycastHit | Null if no gameObject is hit. |
intersectedObject
Reference to the intersected TrainAR object.
Declaration
public GameObject intersectedObject
Field Value
Type | Description |
---|---|
GameObject | Changed when TrainAR object are intersecting. |
isGrabbingObject
Changes value when an object is grabbed/released.
Declaration
public bool isGrabbingObject
Field Value
Type | Description |
---|---|
System.Boolean | True if a object is grabbed. |
isIntersecting
Changed on intersection.
Declaration
public bool isIntersecting
Field Value
Type | Description |
---|---|
System.Boolean | True if TrainAR objects ar intersecting. |
isSelectingObject
Changed when TrainAR object is selected/deselected.
Declaration
public bool isSelectingObject
Field Value
Type | Description |
---|---|
System.Boolean | True if a object is selected. |
selectedObject
Reference to the current selected(aimed at) TrainAR object.
Declaration
public GameObject selectedObject
Field Value
Type | Description |
---|---|
GameObject | Changed on selection. |
tryedGrabbingObjectUnsuccessfully
Value is changed when the grab button is pressed.
Declaration
public bool tryedGrabbingObjectUnsuccessfully
Field Value
Type | Description |
---|---|
System.Boolean | True if a grabbing of an object was not successfull. |
Methods
| Improve this Doc View SourceCombine()
Invokes the Combine on the TrainARObject. Important: This method assumes there is an object selected and it is currently intersecting with another. It also assumes that ARInteractables have an ObjectInteraktionhandler.
Declaration
public void Combine()
GrabObject()
Grab the object that is currently selected by the raycast.
Declaration
public void GrabObject()
Interact()
Invokes the Interact on the TrainARObject. Important: This method assumes there is an object selected! It also assumes that ARInteractables have an ObjectInteraktionhandler.
Declaration
public void Interact()
ReleaseGrabbedObject(Boolean)
Release the currently grabbed object.
Declaration
public void ReleaseGrabbedObject(bool fusedObject = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | fusedObject |