Skip to main content

GrabAssistSettings

A class in Root.Township, the global namespace.

Global settings for grab assist, which searches a short path from the hand to find an item to grab and draws the path and target. Get it with GlobalSettings<GrabAssistSettings>.Instance.

Constructors​

MemberWhat it is
GrabAssistSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

21 private and internal fields
MemberWhat it is
private Vector3 assistGrabDirectionBacking field for AssistGrabDirection: the hand-relative direction the assist points.
private float assistLengthBacking field for AssistLength: the assist reach, scaled by how far down the hand points.
private Material assistPathMaterialPath indicator material on non-Android platforms.
private Material assistPathMaterialAndroidPath indicator material on Android.
private Mesh assistPathMeshPath indicator mesh on non-Android platforms.
private Mesh assistPathMeshAndroidPath indicator mesh on Android.
private Material assistTargetMaterialBacking field for AssistTargetMaterial.
private Mesh assistTargetMeshBacking field for AssistTargetMesh.
private Material assistTargetNotFoundMaterialBacking field for TargetNotFoundMaterial.
private float detectionRadiusBacking field for DetectionRadius.
private Color foundTargetColorBacking field for FoundTargetColor.
private float maximumAngleFromDownToBeActiveDotBacking field for MaximumAngleFromDownToBeActiveDot, stored as a dot product from an angle.
private Color noTargetColorBacking field for NoTargetColor.
private LayerMask obstacleLayerMaskBacking field for ObstacleLayerMask.
private Vector3 pathIndicatorScaleBacking field for PathIndicatorScale.
private float pathIntervalBacking field for PathInterval: spacing between path indicators and the minimum assist length.
private float smoothDampTimeBacking field for SmoothDampTime.
private float startDelayBacking field for StartDelay: seconds before the assist becomes active.
private Vector3 targetIndicatorScaleBacking field for TargetIndicatorScale.
private AnimationCurve targetIndicatorScaleCurveBacking field for TargetIndicatorScaleCurve.
private float verticalPowerBacking field for VerticalPower: exponent on the downward direction when working out assist length.

Properties​

MemberWhat it is
Vector3 AssistGrabDirection { get; }Local direction from the hand the assist searches along (mirrored for the right hand).
float AssistLength { get; }Longest search distance, reduced as the direction points less downward.
Material AssistPathMaterial { get; }Material for the path indicator (an Android version on Android).
Mesh AssistPathMesh { get; }Mesh for the path indicator (an Android version on Android).
Material AssistTargetMaterial { get; }Material for the target indicator when a target is found.
Mesh AssistTargetMesh { get; }Mesh for the target indicator.
float DetectionRadius { get; }Radius of the sphere cast used to find targets.
Color FoundTargetColor { get; }Path colour when a target is found.
float MaximumAngleFromDownToBeActiveDot { get; }The search direction must be at least this close to straight down (as a dot product) for the assist to run.
Color NoTargetColor { get; }Path colour when nothing is found.
LayerMask ObstacleLayerMask { get; }Layers that block the search.
Vector3 PathIndicatorScale { get; }Scale of each path indicator mesh.
float PathInterval { get; }Spacing between path indicator meshes, and the shortest search length.
float SmoothDampTime { get; }Smoothing time for the path indicator's movement.
float StartDelay { get; }Delay before the assist starts searching.
Vector3 TargetIndicatorScale { get; }Scale of the target indicator.
AnimationCurve TargetIndicatorScaleCurve { get; }Curve animating the target indicator's scale.
Material TargetNotFoundMaterial { get; }Material for the target indicator when nothing is found.
float VerticalPower { get; }Power applied to the direction's downward part when working out the search length.

Used in​

Members of other types that take, return or hold a GrabAssistSettings: