![]() |
Adventure Creator
1.76.2
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
virtual bool | TypeSupportsSnapConnections () |
virtual float | GetDecimalAlong (Moveable_Drag draggable) |
Gets the proportion along the track that an object is positioned. More... | |
virtual void | SetPositionAlong (float proportionAlong, Moveable_Drag draggable) |
Positions an object on a specific point along the track. More... | |
virtual void | Connect (Moveable_Drag draggable) |
Connects an object to the track when the game begins. More... | |
void | OnDisconnect (Moveable_Drag draggable) |
Called when an object attached to the track is disconnected from it. More... | |
virtual void | ApplyDragForce (Vector3 force, Moveable_Drag draggable) |
Applies a force to an object connected to the track. More... | |
virtual float | GetScreenPointProportionAlong (Vector2 point, Vector3 grabRelativePosition, Moveable_Drag drag) |
Gets the proportion along the track closest to a given position in screen-space More... | |
float | GetMinDistanceToScreenPoint (Vector2 point) |
Gets the smallest distance, in screen-space, between a given position in screen space, and the point on the track that it is closest to. More... | |
virtual void | ApplyAutoForce (float _position, float _speed, Moveable_Drag draggable, bool ignoreMaxSpeed) |
Applies a force that, when applied every frame, pushes an object connected to the track towards a specific point along it. More... | |
virtual void | UpdateDraggable (Moveable_Drag draggable) |
Updates the position of an object connected to the track. This is called every frame. More... | |
void | OnLetGo (Moveable_Drag draggable) |
Called whenever an object attached to the track is let go by the player More... | |
virtual void | SnapToTrack (Moveable_Drag draggable, bool onStart) |
Corrects the position of an object so that it is placed along the track. More... | |
virtual bool | IconIsStationary () |
Checks if the icon that can display when an object is moved along the track remains in the same place as the object moves. More... | |
virtual Vector3 | GetGizmoPosition (float proportionAlong) |
Gets the position of gizmos at a certain position along the track More... | |
virtual Vector3 | GetForceToPosition (Moveable_Drag draggable, float targetProportionAlong) |
Calculates a force to get a draggable object to a given point along the track More... | |
virtual float | GetMoveSoundIntensity (float deltaTrackPosition) |
TrackSnapData | GetSnapData (int regionID) |
Gets TrackSnapData for a snap point More... | |
float | GetRegionPositionAlong (int regionID) |
Gets the position along the track for the centre of a given region More... | |
bool | IsWithinTrackRegion (float trackValue, int regionID) |
Checks if a position along the track is within a given track region More... | |
virtual float | GetForceDotProduct (Vector3 force, Moveable_Drag draggable) |
Public Attributes | |
PhysicMaterial | colliderMaterial |
float | discSize = 0.2f |
Color | handleColour = Color.white |
DragMovementCalculation | dragMovementCalculation = DragMovementCalculation.DragVector |
bool | doSnapping = false |
List< TrackSnapData > | allTrackSnapData = new List<TrackSnapData>() |
float | snapSpeed = 100f |
bool | onlySnapOnPlayerRelease |
bool | preventEndToEndJumping = false |
ActionListSource | actionListSource = ActionListSource.InScene |
Protected Member Functions | |
void | DoRegionAudioCheck (Moveable_Drag draggable) |
virtual void | AssignColliders (Moveable_Drag draggable) |
void | DoSnapCheck (Moveable_Drag draggable) |
void | DoConnectionCheck (Moveable_Drag draggable) |
void | SnapToNearest (Moveable_Drag draggable) |
void | LimitCollisions (Moveable_Drag draggable) |
Vector3 | RotatePointAroundPivot (Vector3 point, Vector3 pivot, Quaternion rotation) |
Properties | |
virtual bool | Loops [get] |
virtual bool | UsesEndColliders [get] |
Transform | Transform [get] |
The base class for "tracks", which are used to contrain Moveable_Drag objects along a pre-determined path
|
virtual |
Applies a force that, when applied every frame, pushes an object connected to the track towards a specific point along it.
_position | The proportion along which to place the Moveable_Drag object (0 to 1) |
_speed | The speed to move by |
draggable | The draggable object to move |
ignoreMaxSpeed | If False, the object's maxSpeed will limit the speed |
Reimplemented in AC.DragTrack_Straight, AC.DragTrack_Curved, and AC.DragTrack_Hinge.
|
virtual |
Applies a force to an object connected to the track.
force | The drag force vector input by the player |
draggable | The Moveable_Drag object to apply the force to |
Reimplemented in AC.DragTrack_Straight, AC.DragTrack_Hinge, and AC.DragTrack_Curved.
|
virtual |
Connects an object to the track when the game begins.
draggable | The Moveable_Drag object to connect to the track |
Reimplemented in AC.DragTrack_Curved, AC.DragTrack_Straight, and AC.DragTrack_Hinge.
|
virtual |
Gets the proportion along the track that an object is positioned.
draggable | The Moveable_Drag object to check the position of |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
|
virtual |
Calculates a force to get a draggable object to a given point along the track
draggable | The draggable object |
targetProportionAlong | How far along the track to calculate a force for |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
|
virtual |
Gets the position of gizmos at a certain position along the track
proportionAlong | The proportio along the track to get the gizmo position of |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
float AC.DragTrack.GetMinDistanceToScreenPoint | ( | Vector2 | point | ) |
Gets the smallest distance, in screen-space, between a given position in screen space, and the point on the track that it is closest to.
point | The point, in screen space |
float AC.DragTrack.GetRegionPositionAlong | ( | int | regionID | ) |
Gets the position along the track for the centre of a given region
regionID | The ID of the region to get the position of |
|
virtual |
Gets the proportion along the track closest to a given position in screen-space
point | The position in screen-space |
grabRelativePosition | The grab position relative to the draggable's centre |
dragm | The object being dragged |
Reimplemented in AC.DragTrack_Straight, AC.DragTrack_Hinge, and AC.DragTrack_Curved.
TrackSnapData AC.DragTrack.GetSnapData | ( | int | regionID | ) |
Gets TrackSnapData for a snap point
regionID | The ID of the region to get data for |
|
virtual |
Checks if the icon that can display when an object is moved along the track remains in the same place as the object moves.
Reimplemented in AC.DragTrack_Straight.
bool AC.DragTrack.IsWithinTrackRegion | ( | float | trackValue, |
int | regionID | ||
) |
Checks if a position along the track is within a given track region
trackValue | The distance along the track, as a decimal of its total length |
snapID | The ID number of the snap region |
void AC.DragTrack.OnDisconnect | ( | Moveable_Drag | draggable | ) |
Called when an object attached to the track is disconnected from it.
draggable | The Moveable_Drag object being disconnected from the track |
void AC.DragTrack.OnLetGo | ( | Moveable_Drag | draggable | ) |
Called whenever an object attached to the track is let go by the player
draggable | The draggable object |
|
virtual |
Positions an object on a specific point along the track.
proportionAlong | The proportion along which to place the Moveable_Drag object (0 to 1) |
draggable | The Moveable_Drag object to reposition |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
|
virtual |
Corrects the position of an object so that it is placed along the track.
draggable | The Moveable_Drag object to snap onto the track |
onStart | Is True if the game has just begun (i.e. this function is being run for the first time) |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
|
virtual |
Returns true if this type of track supports connections with other tracks via snapping
Reimplemented in AC.DragTrack_Curved, and AC.DragTrack_Straight.
|
virtual |
Updates the position of an object connected to the track. This is called every frame.
draggable | The Moveable_Drag object to update the position of |
Reimplemented in AC.DragTrack_Hinge, AC.DragTrack_Curved, and AC.DragTrack_Straight.
ActionListSource AC.DragTrack.actionListSource = ActionListSource.InScene |
Where to locate interactions
List<TrackSnapData> AC.DragTrack.allTrackSnapData = new List<TrackSnapData>() |
A list of all the points along the track that attached objects can snap to, if doSnapping = True
PhysicMaterial AC.DragTrack.colliderMaterial |
The Physics Material to give the track's end colliders
float AC.DragTrack.discSize = 0.2f |
The size of the track's end colliders, as seen in the Scene window
bool AC.DragTrack.doSnapping = false |
If True, then snapping is enabled and any object attached to the track can snap to pre-set points along it when let go by the player
DragMovementCalculation AC.DragTrack.dragMovementCalculation = DragMovementCalculation.DragVector |
How input movement is calculated (DragVector, CursorPosition)
Color AC.DragTrack.handleColour = Color.white |
The colour of Scene window Handles
bool AC.DragTrack.onlySnapOnPlayerRelease |
If True, then snapping will only occur when the player releases the object - and not when moving on its own accord
bool AC.DragTrack.preventEndToEndJumping = false |
If True, and the track doesn't loop, then the dragged object will be prevented from jumping from one end to the other without first moving somewhere in between
float AC.DragTrack.snapSpeed = 100f |
The speed to move by when attached objects snap
|
get |
Checks if the track is on a loop
|
get |
A cache of the tracks's transform component
|
get |
If True, end-colliders are generated to prevent draggable objects from leaving the track's boundaries