C# Class AbstractGoTween, wepwep

base class shared by the Tween and TweenChain classes to allow a seemless API when controlling either of them
Show file Open project: encephalopathy/wepwep Class Usage Examples

Public Properties

Property Type Description
id int

Protected Properties

Property Type Description
_completedIterations int
_deltaIterations int
_didBegin bool
_didInit bool
_didIterateLastFrame bool
_didIterateThisFrame bool
_elapsedTime float
_fireIterationEnd bool
_fireIterationStart bool
_isLoopingBackOnPingPong bool
_onBegin Action
_onComplete Action
_onInit Action
_onIterationEnd Action
_onIterationStart Action
_onUpdate Action
_totalElapsedTime float

Public Methods

Method Description
allTweenProperties ( ) : List

returns a list of all the TweenProperties contained in the tween and all its children (if it is a TweenChain or a TweenFlow) technically, this should be marked as internal

complete ( ) : void

completes the tween. sets the playhead to it's final position as if the tween completed normally. takes into account if the tween was playing forward or reversed.

containsTweenProperty ( AbstractTweenProperty, property ) : bool

returns true if the tween contains the same type (or propertyName) property in its property list technically, this should be marked as internal

destroy ( ) : void

removes the Tween from action and cleans up its state

goTo ( float time ) : void

goes to the specified time clamping it from 0 to the total duration of the tween. if the tween is not playing it can optionally be force updated to the time specified. delays are not taken into effect. (must be implemented by inherited classes.)

goToAndPlay ( float time ) : void

goes to the time and starts playback skipping any delays

isValid ( ) : bool

subclasses should return true if they are a valid and ready to be added to the list of running tweens or false if not ready. technically, this should be marked as internal

pause ( ) : void

pauses playback

play ( ) : void

resumes playback

playBackwards ( ) : void

plays the tween backwards. if it is already playing backwards has no effect

playForward ( ) : void

plays the tween forward. if it is already playing forward has no effect

removeTweenProperty ( AbstractTweenProperty, property ) : bool

attempts to remove the tween property returning true if successful technically, this should be marked as internal

restart ( bool skipDelay = true ) : void

rewinds the tween to the beginning (or end, depending on isReversed) and starts playback, optionally skipping delay (only relevant for Tweens).

reverse ( ) : void

reverses playback. if going forward it will be going backward after this and vice versa.

rewind ( ) : void

rewinds the tween to the beginning (or end, depending on isReversed) and pauses playback.

setOnBeginHandler ( Action onBegin ) : void
setOnCompleteHandler ( Action onComplete ) : void
setOnInitHandler ( Action onInit ) : void
setOnUpdateHandler ( Action onUpdate ) : void
setonIterationEndHandler ( Action onIterationEnd ) : void
setonIterationStartHandler ( Action onIterationStart ) : void
update ( float deltaTime ) : bool

tick method. if it returns true it indicates the tween is complete. note: at it's base, AbstractGoTween does not fire events, it is up to the implementer to do so. see GoTween and AbstractGoTweenCollection for examples.

waitForCompletion ( ) : IEnumerator

waits for either completion or destruction. call in a Coroutine and yield on the return

Protected Methods

Method Description
onBegin ( ) : void

called whenever the tween is updated and the playhead is at the start (or end, depending on isReversed) of the tween.

onComplete ( ) : void

called when the tween completes playing.

onInit ( ) : void

called once per tween when it is first updated

onIterationEnd ( ) : void

called once per iteration at the end of the iteration.

onIterationStart ( ) : void

called once per iteration at the start of the iteration.

onUpdate ( ) : void

called once per update, after the update has occured.

reset ( ) : void

resets the tween to the beginning, taking isReversed into account.

Method Details

allTweenProperties() public abstract method

returns a list of all the TweenProperties contained in the tween and all its children (if it is a TweenChain or a TweenFlow) technically, this should be marked as internal
public abstract allTweenProperties ( ) : List
return List

complete() public method

completes the tween. sets the playhead to it's final position as if the tween completed normally. takes into account if the tween was playing forward or reversed.
public complete ( ) : void
return void

containsTweenProperty() public abstract method

returns true if the tween contains the same type (or propertyName) property in its property list technically, this should be marked as internal
public abstract containsTweenProperty ( AbstractTweenProperty, property ) : bool
property AbstractTweenProperty,
return bool

destroy() public method

removes the Tween from action and cleans up its state
public destroy ( ) : void
return void

goTo() public abstract method

goes to the specified time clamping it from 0 to the total duration of the tween. if the tween is not playing it can optionally be force updated to the time specified. delays are not taken into effect. (must be implemented by inherited classes.)
public abstract goTo ( float time ) : void
time float
return void

goToAndPlay() public method

goes to the time and starts playback skipping any delays
public goToAndPlay ( float time ) : void
time float
return void

isValid() public abstract method

subclasses should return true if they are a valid and ready to be added to the list of running tweens or false if not ready. technically, this should be marked as internal
public abstract isValid ( ) : bool
return bool

onBegin() protected method

called whenever the tween is updated and the playhead is at the start (or end, depending on isReversed) of the tween.
protected onBegin ( ) : void
return void

onComplete() protected method

called when the tween completes playing.
protected onComplete ( ) : void
return void

onInit() protected method

called once per tween when it is first updated
protected onInit ( ) : void
return void

onIterationEnd() protected method

called once per iteration at the end of the iteration.
protected onIterationEnd ( ) : void
return void

onIterationStart() protected method

called once per iteration at the start of the iteration.
protected onIterationStart ( ) : void
return void

onUpdate() protected method

called once per update, after the update has occured.
protected onUpdate ( ) : void
return void

pause() public method

pauses playback
public pause ( ) : void
return void

play() public method

resumes playback
public play ( ) : void
return void

playBackwards() public method

plays the tween backwards. if it is already playing backwards has no effect
public playBackwards ( ) : void
return void

playForward() public method

plays the tween forward. if it is already playing forward has no effect
public playForward ( ) : void
return void

removeTweenProperty() public abstract method

attempts to remove the tween property returning true if successful technically, this should be marked as internal
public abstract removeTweenProperty ( AbstractTweenProperty, property ) : bool
property AbstractTweenProperty,
return bool

reset() protected method

resets the tween to the beginning, taking isReversed into account.
protected reset ( ) : void
return void

restart() public method

rewinds the tween to the beginning (or end, depending on isReversed) and starts playback, optionally skipping delay (only relevant for Tweens).
public restart ( bool skipDelay = true ) : void
skipDelay bool
return void

reverse() public method

reverses playback. if going forward it will be going backward after this and vice versa.
public reverse ( ) : void
return void

rewind() public method

rewinds the tween to the beginning (or end, depending on isReversed) and pauses playback.
public rewind ( ) : void
return void

setOnBeginHandler() public method

public setOnBeginHandler ( Action onBegin ) : void
onBegin Action
return void

setOnCompleteHandler() public method

public setOnCompleteHandler ( Action onComplete ) : void
onComplete Action
return void

setOnInitHandler() public method

public setOnInitHandler ( Action onInit ) : void
onInit Action
return void

setOnUpdateHandler() public method

public setOnUpdateHandler ( Action onUpdate ) : void
onUpdate Action
return void

setonIterationEndHandler() public method

public setonIterationEndHandler ( Action onIterationEnd ) : void
onIterationEnd Action
return void

setonIterationStartHandler() public method

public setonIterationStartHandler ( Action onIterationStart ) : void
onIterationStart Action
return void

update() public method

tick method. if it returns true it indicates the tween is complete. note: at it's base, AbstractGoTween does not fire events, it is up to the implementer to do so. see GoTween and AbstractGoTweenCollection for examples.
public update ( float deltaTime ) : bool
deltaTime float
return bool

waitForCompletion() public method

waits for either completion or destruction. call in a Coroutine and yield on the return
public waitForCompletion ( ) : IEnumerator
return IEnumerator

Property Details

_completedIterations protected property

protected int _completedIterations
return int

_deltaIterations protected property

protected int _deltaIterations
return int

_didBegin protected property

protected bool _didBegin
return bool

_didInit protected property

protected bool _didInit
return bool

_didIterateLastFrame protected property

protected bool _didIterateLastFrame
return bool

_didIterateThisFrame protected property

protected bool _didIterateThisFrame
return bool

_elapsedTime protected property

protected float _elapsedTime
return float

_fireIterationEnd protected property

protected bool _fireIterationEnd
return bool

_fireIterationStart protected property

protected bool _fireIterationStart
return bool

_isLoopingBackOnPingPong protected property

protected bool _isLoopingBackOnPingPong
return bool

_onBegin protected property

protected Action _onBegin
return Action

_onComplete protected property

protected Action _onComplete
return Action

_onInit protected property

protected Action _onInit
return Action

_onIterationEnd protected property

protected Action _onIterationEnd
return Action

_onIterationStart protected property

protected Action _onIterationStart
return Action

_onUpdate protected property

protected Action _onUpdate
return Action

_totalElapsedTime protected property

protected float _totalElapsedTime
return float

id public property

public int id
return int