Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.TrackSnapData Class Reference

Public Member Functions

 TrackSnapData (float _positionAlong, int[] idArray)
TrackSnapData ShowGUI (DragTrack dragTrack, bool useAngles, System.Action< ActionList > showALEditor, System.Action< ActionListAsset > showALAEditor)
void DrawConnectionHandles (DragTrack track)
Vector3 GetWorldPosition (DragTrack track)
 Gets the position in world space of the centre of the snap region.
float GetDistanceFrom (float trackValue)
 Gets the distance, in Unity units, between a region along the track and the centre of a snapping point.
void EvaluateConnectionPoints (DragTrack track, Moveable_Drag draggable, Vector3 dragForce)
void MoveTo (Moveable_Drag draggable, float speed)
 Moves a draggable object towards the snap point.
bool IsWithinRegion (float trackValue)
 Checks if a region along the track is within the snap's region.
void RunSnapCutscene (ActionListSource actionListSource)
 Runs the 'on snap' ActionList associated with the region.

Protected Attributes

bool isDisabled = false
float positionAlong
float width
int id
List< TrackSnapConnectionconnections = new List<TrackSnapConnection>()
Cutscene cutsceneOnSnap = null
AudioClip soundOnEnter = null
ActionListAsset actionListAssetOnSnap = null
string label
Color gizmoColor

Properties

float PositionAlong [get]
float Width [get]
int ID [get]
bool IsEnabled [get, set]
AudioClip SoundOnEnter [get]
string EditorLabel [get]
Color GizmoColor [get]

Detailed Description

Stores information related to snapping draggable objects along tracks.

Constructor & Destructor Documentation

◆ TrackSnapData()

AC.TrackSnapData.TrackSnapData ( float _positionAlong,
int[] idArray )

The default constructor

Member Function Documentation

◆ GetDistanceFrom()

float AC.TrackSnapData.GetDistanceFrom ( float trackValue)

Gets the distance, in Unity units, between a region along the track and the centre of a snapping point.

Parameters
trackValueThe distance along the track, as a decimal of its total length
Returns
The distance between the draggable object and the centre of the snapping point

◆ GetWorldPosition()

Vector3 AC.TrackSnapData.GetWorldPosition ( DragTrack track)

Gets the position in world space of the centre of the snap region.

Parameters
trackThe track that the snap region is a part of.
Returns
The snap region's position in world space

◆ IsWithinRegion()

bool AC.TrackSnapData.IsWithinRegion ( float trackValue)

Checks if a region along the track is within the snap's region.

Parameters
trackValueThe distance along the track, as a decimal of its total length
Returns
True if a region along the track is within the snap's region</region>

◆ MoveTo()

void AC.TrackSnapData.MoveTo ( Moveable_Drag draggable,
float speed )

Moves a draggable object towards the snap point.

Parameters
draggableThe object to move
speedHow fast to move the object by

◆ RunSnapCutscene()

void AC.TrackSnapData.RunSnapCutscene ( ActionListSource actionListSource)

Runs the 'on snap' ActionList associated with the region.

Parameters
actionListSourceThe source of the ActionList (InScene, AssetFile)

Property Documentation

◆ ID

int AC.TrackSnapData.ID
get

A unique identifier

◆ IsEnabled

bool AC.TrackSnapData.IsEnabled
getset

If True, the region is enabled

◆ PositionAlong

float AC.TrackSnapData.PositionAlong
get

How far along the track the snap point is

◆ SoundOnEnter

AudioClip AC.TrackSnapData.SoundOnEnter
get

The sound to play when a draggable enters this region

◆ Width

float AC.TrackSnapData.Width
get

How wide, as a proportion of the track length, the snap point is valid for