Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.Moveable Class Reference
Inheritance diagram for AC.Moveable:
AC.DragBase AC.Moveable_Drag AC.Moveable_PickUp

Public Member Functions

void StopMoving ()
bool IsMoving (TransformType transformType)
bool IsMoving ()
void EndMovement ()
void Move (Vector3 _newVector, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, TransformType _transformType, bool _doEulerRotation, AnimationCurve _timeCurve, bool clearExisting)
 Moves the GameObject by referencing a Vector3 as its target Transform.
void Move (Marker _marker, MoveMethod _moveMethod, bool _inWorldSpace, float _transitionTime, AnimationCurve _timeCurve, bool _copyMarkerPosition=true, bool _copyMarkerRotation=true, bool _copyMarkerScale=true)
 Moves the GameObject by referencing a Marker component as its target Transform.
MoveableData SaveData (MoveableData saveData)
 Updates a MoveableData class with its own variables that need saving.
void LoadData (MoveableData saveData)
 Updates its own variables from a MoveableData class.
Vector3 GetTargetPosition ()

Public Attributes

bool predictCollisions

Protected Member Functions

virtual void Awake ()
virtual void OnEnable ()
virtual void OnDisable ()
void Update ()
void Kill ()

Protected Attributes

float positionChangeTime
float positionStartTime
AnimationCurve positionTimeCurve
MoveMethod positionMethod
Vector3 startPosition
Vector3 endPosition
bool inWorldSpace
float rotateChangeTime
float rotateStartTime
AnimationCurve rotateTimeCurve
MoveMethod rotateMethod
bool doEulerRotation = false
Vector3 startEulerRotation
Vector3 endEulerRotation
Quaternion startRotation
Quaternion endRotation
bool copyMarkerPosition
bool copyMarkerRotation
bool copyMarkerScale
float scaleChangeTime
float scaleStartTime
AnimationCurve scaleTimeCurve
MoveMethod scaleMethod
Vector3 startScale
Vector3 endScale
Char character
Rigidbody _rigidbody
Rigidbody2D _rigidbody2D

Properties

Rigidbody Rigidbody [get]
Transform Transform [get]

Detailed Description

This script provides functions to move or transform the GameObject it is attached to. It is used by the "Object: Transform" Action to move objects without scripting.

Member Function Documentation

◆ EndMovement()

void AC.Moveable.EndMovement ( )

Halts the GameObject, and sets its Transform to its target values, if it is being moved by this script.

◆ LoadData()

void AC.Moveable.LoadData ( MoveableData saveData)

Updates its own variables from a MoveableData class.

Parameters
saveDataThe MoveableData class to load from

◆ Move() [1/2]

void AC.Moveable.Move ( Marker _marker,
MoveMethod _moveMethod,
bool _inWorldSpace,
float _transitionTime,
AnimationCurve _timeCurve,
bool _copyMarkerPosition = true,
bool _copyMarkerRotation = true,
bool _copyMarkerScale = true )

Moves the GameObject by referencing a Marker component as its target Transform.

Parameters
_markerA Marker whose position, rotation and scale will be the target values of the GameObject
_moveMethodThe interpolation method by which the GameObject moves (Linear, Smooth, Curved, EaseIn, EaseOut, CustomCurve)
_inWorldSpaceIf True, the movement will use world-space co-ordinates
_transitionTimeThe time, in seconds, that the movement should take place over
_timeCurveIf _moveMethod = MoveMethod.CustomCurve, then the movement speed will follow the shape of the supplied AnimationCurve. This curve can exceed "1" in the Y-scale, allowing for overshoot effects.

◆ Move() [2/2]

void AC.Moveable.Move ( Vector3 _newVector,
MoveMethod _moveMethod,
bool _inWorldSpace,
float _transitionTime,
TransformType _transformType,
bool _doEulerRotation,
AnimationCurve _timeCurve,
bool clearExisting )

Moves the GameObject by referencing a Vector3 as its target Transform.

Parameters
_newVectorThe target values of either the GameObject's position, rotation or scale
_moveMethodThe interpolation method by which the GameObject moves (Linear, Smooth, Curved, EaseIn, EaseOut, CustomCurve)
_inWorldSpaceIf True, the movement will use world-space co-ordinates
_transitionTimeThe time, in seconds, that the movement should take place over
_transformTypeThe way in which the GameObject should be transformed (Translate, Rotate, Scale)
_doEulerRotationIf True, then the GameObject's eulerAngles will be directly manipulated. Otherwise, the rotation as a Quaternion will be affected.
_timeCurveIf _moveMethod = MoveMethod.CustomCurve, then the movement speed will follow the shape of the supplied AnimationCurve. This curve can exceed "1" in the Y-scale, allowing for overshoot effects.
clearExistingIf True, then existing transforms will be stopped before new transforms will be made

◆ SaveData()

MoveableData AC.Moveable.SaveData ( MoveableData saveData)

Updates a MoveableData class with its own variables that need saving.

Parameters
saveDataThe original MoveableData class
Returns
The updated MoveableData class

◆ StopMoving()

void AC.Moveable.StopMoving ( )

Halts the GameObject, if it is being moved by this script.

Member Data Documentation

◆ predictCollisions

bool AC.Moveable.predictCollisions

If True, then movement will not occur if it results in a collision

Property Documentation

◆ Rigidbody

Rigidbody AC.Moveable.Rigidbody
get

The attached Rigidbody

◆ Transform

Transform AC.Moveable.Transform
get

A cache of the Hotspot's transform component