Search Results for

    Show / Hide Table of Contents

    Class InteractionController

    Handles the interactions, i.e. grabbing, releasing, interacting and combining of the TrainARObjects.

    Inheritance
    System.Object
    InteractionController
    Namespace: Interaction
    Assembly: Assembly-CSharp.dll
    Syntax
    public class InteractionController : MonoBehaviour

    Fields

    | Improve this Doc View Source

    grabbedObject

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    intersectedObject

    Reference to the intersected TrainAR object.

    Declaration
    public GameObject intersectedObject
    Field Value
    Type Description
    GameObject

    Changed when TrainAR object are intersecting.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    isIntersecting

    Changed on intersection.

    Declaration
    public bool isIntersecting
    Field Value
    Type Description
    System.Boolean

    True if TrainAR objects ar intersecting.

    | Improve this Doc View Source

    isSelectingObject

    Changed when TrainAR object is selected/deselected.

    Declaration
    public bool isSelectingObject
    Field Value
    Type Description
    System.Boolean

    True if a object is selected.

    | Improve this Doc View Source

    selectedObject

    Reference to the current selected(aimed at) TrainAR object.

    Declaration
    public GameObject selectedObject
    Field Value
    Type Description
    GameObject

    Changed on selection.

    | Improve this Doc View Source

    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 Source

    Combine()

    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()
    | Improve this Doc View Source

    GrabObject()

    Grab the object that is currently selected by the raycast.

    Declaration
    public void GrabObject()
    | Improve this Doc View Source

    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()
    | Improve this Doc View Source

    ReleaseGrabbedObject(Boolean)

    Release the currently grabbed object.

    Declaration
    public void ReleaseGrabbedObject(bool fusedObject = false)
    Parameters
    Type Name Description
    System.Boolean fusedObject
    • Improve this Doc
    • View Source
    In This Article
    Back to top TrainAR Documentation