Search Results for

    Show / Hide Table of Contents

    Class TrainARObject

    The main behaviour script for a TrainAR object. This is automatically added when converting GameObject to TrainAR objects After adding this script all following RequiredComponents are added. SelectionBase, MeshCollider, BoxCollider, RigidbodyController, MaterialController, AudioController, Rigidbody, Outline, CollisionController. The TrainAR events that are triggered on actions are also defined in this script.

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

    Fields

    | Improve this Doc View Source

    error

    Error event. Triggered when an action is triggered on this TrainAR object that was not accepted by the statemachine.

    Declaration
    public UnityEvent error
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    interactableName

    The name of the TrainAR object that is used for the statemachine check. By default, this is the name of the TrainAR object.

    Declaration
    public string interactableName
    Field Value
    Type Description
    System.String

    String based on the object name.

    | Improve this Doc View Source

    Intersection

    The Object this object is currently intersecting with.

    Declaration
    public CollisionController.Intersection Intersection
    Field Value
    Type Description
    CollisionController.Intersection

    Is set on runtime.

    | Improve this Doc View Source

    isCombinable

    Is the object combineable?

    Declaration
    public bool isCombinable
    Field Value
    Type Description
    System.Boolean

    If true it is combinable.

    | Improve this Doc View Source

    isGrabbable

    Is the object grabbable?

    Declaration
    public bool isGrabbable
    Field Value
    Type Description
    System.Boolean

    If true it is grabbable.

    | Improve this Doc View Source

    isGrabbed

    Declaration
    public bool isGrabbed
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    isInteractable

    Is the object interactable?

    Declaration
    public bool isInteractable
    Field Value
    Type Description
    System.Boolean

    If true it is interactable.

    | Improve this Doc View Source

    isSelected

    Declaration
    public bool isSelected
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    lerpingDistance

    The distance in front of the camera, where the object is lerped to. This can e.g. be useful, if objects are larger than usual.

    Declaration
    public float lerpingDistance
    Field Value
    Type Description
    System.Single

    Default is 0.2f

    | Improve this Doc View Source

    OnCombination

    Declaration
    public TrainARObject.CustomUnityEvent OnCombination
    Field Value
    Type Description
    TrainARObject.CustomUnityEvent
    | Improve this Doc View Source

    OnDeselect

    Declaration
    public UnityEvent OnDeselect
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    OnGrabbed

    Declaration
    public UnityEvent OnGrabbed
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    OnInteraction

    Declaration
    public UnityEvent OnInteraction
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    OnReleased

    Declaration
    public UnityEvent OnReleased
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    OnSelect

    Declaration
    public UnityEvent OnSelect
    Field Value
    Type Description
    UnityEvent
    | Improve this Doc View Source

    pivotOffsetPosition

    Offset of the pivot point. Use this, if the given pivot point by the model is weird.

    Declaration
    public Vector3 pivotOffsetPosition
    Field Value
    Type Description
    Vector3

    Default is (0, 0, 0).

    | Improve this Doc View Source

    pivotOffsetRotation

    Offset of the pivot rotation. Use this, if the given pivot point by the model is weird.

    Declaration
    public Vector3 pivotOffsetRotation
    Field Value
    Type Description
    Vector3

    Default is (0, 0, 0).

    | Improve this Doc View Source

    TrainARObjectDisabled

    If true the object is not selectable, grabbable, interactable, combineable but might be visible.

    Declaration
    public bool TrainARObjectDisabled
    Field Value
    Type Description
    System.Boolean

    Default is false.

    Methods

    | Improve this Doc View Source

    Combine(String, GameObject)

    Sends a request to the statemachine to check if this combine was valid. If so, the combine event of this TrainARObject is invoked otherwise the error event is invoked instead.

    This does NOT physically combine the object, which has to be handled by hand or e.g. the TrainAR Object helper in the visual scripting.

    Declaration
    public void Combine(string combinedWithName, GameObject intersectedObject)
    Parameters
    Type Name Description
    System.String combinedWithName
    GameObject intersectedObject
    | Improve this Doc View Source

    Deselect()

    Invokes the Deselect event of this TrainARObject and sets it's isSelected bool accordingly.

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

    DisableTrainARObject()

    Disables interactions with this TrainARObject by disabling it's colliders and Mesh Renderer.

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

    EnableTrainARObject()

    Enables interactions with this TrainARObject by disabling it's colliders and Mesh Renderer.

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

    Error()

    Invokes the error event of this TrainARObject.

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

    Grab()

    Sends a request to the statemachine to check if this grab was valid. If so, the grab event of this TrainARObject is invoked otherwise the error event is invoked instead.

    This does NOT grab the object, which is handled in the InteractionController

    Declaration
    public bool Grab()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Interact(String)

    Sends a request to the statemachine to check if this interaction was valid. If so, the interact event of this TrainARObject is invoked otherwise the error event is invoked instead.

    Declaration
    public void Interact(string parameter = " ")
    Parameters
    Type Name Description
    System.String parameter

    A string parameter which is passed to the statemachine.

    | Improve this Doc View Source

    Release()

    Invokes the Release event of this TrainARObject and sets it's isGrabbed bool accordingly.

    This does NOT release the object, which is handled in the InteractionController

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

    Select()

    Invokes the select event of this TrainARObject and sets it's isSelected bool accordingly.

    Declaration
    public void Select()
    • Improve this Doc
    • View Source
    In This Article
    Back to top TrainAR Documentation