DoopelPonger
Public Types | Public Member Functions | Public Attributes | List of all members
TweenTo Class Reference

A generic class used to move one object to another. Event though it's supposed to be generic, it's only used by balls that missed a player. More...

Inheritance diagram for TweenTo:
Inheritance graph
[legend]
Collaboration diagram for TweenTo:
Collaboration graph
[legend]

Public Types

enum  TweenType { TweenType.LINEAR, TweenType.SMOOTH_STEP, TweenType.NONE }
 The type of movement the object should take to get to the target. More...
 

Public Member Functions

void Awake ()
 Initalize the properties of the class. More...
 
void Init ()
 Initializes variables after being object pooled. More...
 
Vector3 GetUnitCircleDirection ()
 
void ApplyRotation (float rotation)
 
void StartMove (TweenType tweenType, Transform targetTransform, float totalTime, int callbackId, System.Func< int, bool > finishedMoveCallback)
 Triggers the start of the tweening. More...
 
void StartMove (TweenType tweenType, Vector3 endPosition, float totalTime, int callbackId, System.Func< int, bool > finishedMoveCallback)
 Triggers the start of the tweening. More...
 
void FinishedMoving ()
 Force the tweening to be done. More...
 
void FixedUpdate ()
 Update the position to the target position. More...
 

Public Attributes

Transform childSprite
 
Vector3 endScale
 

Detailed Description

A generic class used to move one object to another. Event though it's supposed to be generic, it's only used by balls that missed a player.

Member Enumeration Documentation

◆ TweenType

enum TweenTo.TweenType
strong

The type of movement the object should take to get to the target.

Enumerator
LINEAR 
SMOOTH_STEP 
NONE 

Member Function Documentation

◆ ApplyRotation()

void TweenTo.ApplyRotation ( float  rotation)
Parameters
rotationSet the rotation speed of the object.

◆ Awake()

void TweenTo.Awake ( )

Initalize the properties of the class.

◆ FinishedMoving()

void TweenTo.FinishedMoving ( )

Force the tweening to be done.

◆ FixedUpdate()

void TweenTo.FixedUpdate ( )

Update the position to the target position.

◆ GetUnitCircleDirection()

Vector3 TweenTo.GetUnitCircleDirection ( )
Returns
The direction the parent transform is away from the child position.

◆ Init()

void TweenTo.Init ( )

Initializes variables after being object pooled.

◆ StartMove() [1/2]

void TweenTo.StartMove ( TweenType  tweenType,
Transform  targetTransform,
float  totalTime,
int  callbackId,
System.Func< int, bool >  finishedMoveCallback 
)

Triggers the start of the tweening.

Parameters
tweenTypeHow the object should move to the target position.
targetTransformThe final position to move to.
totalTimeHow long it should take to get to the final position.
callbackIdId used to send with the finishedMoveCallback method to notify it has made it to the targetTransform.
finishedMoveCallbackFunction to call once the movement has finished.

◆ StartMove() [2/2]

void TweenTo.StartMove ( TweenType  tweenType,
Vector3  endPosition,
float  totalTime,
int  callbackId,
System.Func< int, bool >  finishedMoveCallback 
)

Triggers the start of the tweening.

Parameters
tweenTypeHow the object should move to the target position.
endPositionThe final position to move to.
totalTimeHow long it should take to get to the final position.
callbackIdId used to send with the finishedMoveCallback method to notify it has made it to the targetTransform.
finishedMoveCallbackFunction to call once the movement has finished.

Member Data Documentation

◆ childSprite

Transform TweenTo.childSprite

The child transform that will be moved.

◆ endScale

Vector3 TweenTo.endScale

The size the object should be at the end of the movement.


The documentation for this class was generated from the following file: