Sequence component. Manager for sequence of Tweeners or other nested Sequences. More...
Classes | |
class | HOTSeqItem |
Single sequencer item. Tween value can be null (in case this is simply used as a spacer). | |
Public Member Functions | |
Sequence () | |
Creates a new Sequence without any parameter. | |
Sequence (SequenceParms p_parms) | |
Creates a new Sequence. | |
void | AppendCallback (TweenDelegate.TweenCallback p_callback) |
Appends the given callback to this Sequence. | |
void | AppendCallback (TweenDelegate.TweenCallbackWParms p_callback, params object[] p_callbackParms) |
Appends the given callback to this Sequence. | |
void | AppendCallback (GameObject p_sendMessageTarget, string p_methodName, object p_value, SendMessageOptions p_options=SendMessageOptions.RequireReceiver) |
Appends the given SendMessage callback to this Sequence. | |
void | InsertCallback (float p_time, TweenDelegate.TweenCallback p_callback) |
Inserts the given callback at the given time position. | |
void | InsertCallback (float p_time, TweenDelegate.TweenCallbackWParms p_callback, params object[] p_callbackParms) |
Inserts the given callback at the given time position. | |
void | InsertCallback (float p_time, GameObject p_sendMessageTarget, string p_methodName, object p_value, SendMessageOptions p_options=SendMessageOptions.RequireReceiver) |
Inserts the given SendMessage callback at the given time position. | |
float | AppendInterval (float p_duration) |
Appends an interval to the right of the sequence, and returns the new Sequence total time length (loops excluded). | |
float | Append (IHOTweenComponent p_twMember) |
Adds the given IHOTweenComponent to the right of the sequence, and returns the new Sequence total time length (loops excluded). | |
float | PrependInterval (float p_duration) |
Prepends an interval to the left of the sequence, and returns the new Sequence total time length (loops excluded). | |
float | Prepend (IHOTweenComponent p_twMember) |
Adds the given IHOTweenComponent to the left of the sequence, moving all the existing sequence elements to the right, and returns the new Sequence total time length (loops excluded). | |
float | Insert (float p_time, IHOTweenComponent p_twMember) |
Inserts the given IHOTweenComponent at the given time, and returns the new Sequence total time length (loops excluded). | |
void | Clear (SequenceParms p_parms=null) |
Clears this sequence and resets its parameters, so it can be re-used. You can check if a Sequence is clean by querying its isEmpty property. | |
override void | Rewind () |
Rewinds this Sequence (loops included), and pauses it. | |
override void | Restart () |
Restarts this Sequence from the beginning (loops included). | |
override bool | IsTweening (object p_target) |
Returns true if the given target is currently involved in a running tween of this Sequence (taking into account also nested tweens). Returns false both if the given target is not inside any of this Sequence tweens, than if the relative tween is paused. To simply check if the target is attached to a tween of this Sequence, use IsLinkedTo( target ) instead. | |
override bool | IsTweening (string p_id) |
Returns true if the tween with the given string id is currently involved in a running tween or sequence. | |
override bool | IsTweening (int p_id) |
Returns true if the tween with the given int id is currently involved in a running tween or sequence. | |
override bool | IsLinkedTo (object p_target) |
Returns true if the given target is linked to a tween of this Sequence (running or not, taking into account also nested tweens). | |
override List< object > | GetTweenTargets () |
Returns a list of all the targets of this Sequence, or NULL if there are none. | |
List< Tweener > | GetTweenersByTarget (object p_target) |
Returns a list of the eventual nested Tweener objects whose target is the given one, or an empty list if none was found. | |
void | Kill () |
Kills this Tweener/Sequence, removes it from HOTween, and cleans it. | |
void | Play () |
Resumes this Tweener/Sequence (tween delay included). | |
void | PlayForward () |
Resumes this Tweener/Sequence (tween delay included) and plays it forward. | |
void | PlayBackwards () |
Resumes this Tweener/Sequence and plays it backwards. | |
void | Pause () |
Pauses this Tweener/Sequence. | |
void | Reverse (bool p_forcePlay=false) |
Reverses this Tweener/Sequence, animating it backwards from its curren position. | |
void | Complete () |
Completes this Tweener/Sequence. Where a loop was involved, the Tweener/Sequence completes at the position where it would actually be after the set number of loops. If there were infinite loops, this method will have no effect. | |
bool | GoTo (float p_time) |
Sends the Tweener/Sequence to the given time (taking also loops into account). If the time is bigger than the total Tweener/Sequence duration, it goes to the end. | |
bool | GoTo (float p_time, bool p_forceUpdate) |
Sends the Tweener/Sequence to the given time (taking also loops into account). If the time is bigger than the total Tweener/Sequence duration, it goes to the end. | |
bool | GoToAndPlay (float p_time) |
Sends the Tweener/Sequence to the given time (taking also loops into account) and plays it. If the time is bigger than the total Tweener/Sequence duration, it goes to the end. | |
bool | GoToAndPlay (float p_time, bool p_forceUpdate) |
Sends the Tweener/Sequence to the given time (taking also loops into account) and plays it. If the time is bigger than the total Tweener/Sequence duration, it goes to the end. | |
IEnumerator | WaitForCompletion () |
A coroutine that waits until the Tweener/Sequence is complete (delays and loops included). You can use it inside a coroutine as a yield. Ex: yield return StartCoroutine( myTweenComponent.WaitForCompletion() );. | |
IEnumerator | WaitForRewind () |
A coroutine that waits until the Tweener/Sequence is rewinded (loops included). You can use it inside a coroutine as a yield. Ex: yield return StartCoroutine( myTweenComponent.WaitForRewind() );. | |
void | ApplyCallback (CallbackType p_callbackType, TweenDelegate.TweenCallback p_callback) |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type. | |
void | ApplyCallback (CallbackType p_callbackType, TweenDelegate.TweenCallbackWParms p_callback, params object[] p_callbackParms) |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type. | |
void | ApplyCallback (CallbackType p_callbackType, GameObject p_sendMessageTarget, string p_methodName, object p_value, SendMessageOptions p_options=SendMessageOptions.RequireReceiver) |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type. This overload will use sendMessage to call the method named p_methodName on every MonoBehaviour in the p_sendMessageTarget GameObject. | |
Properties | |
string | id [get, set] |
Eventual string ID of this Tweener/Sequence (more than one Tweener/Sequence can share the same ID, thus allowing for grouped operations). You can also use intId instead of id for faster operations. | |
int | intId [get, set] |
Eventual int ID of this Tweener/Sequence (more than one Tweener/Sequence can share the same intId, thus allowing for grouped operations). The main difference from id is that while id is more legible, intId allows for faster operations. | |
bool | autoKillOnComplete [get, set] |
Default is true , which means this Tweener/Sequence will be killed and removed from HOTween as soon as it's completed. If false doesn't remove this Tweener/Sequence from HOTween when it is completed, and you will need to call an HOTween.Kill to remove this Tweener/Sequence. | |
bool | enabled [get, set] |
Default is true . If set to false , this Tweener/Sequence will not be updated, and any use of animation methods (Play/Pause/Rewind/etc) will be ignored (both if called directly via this instance, than if using HOTween.Play/Pause/Rewind/etc.). | |
float | timeScale [get, set] |
Time scale that will be used by this Tweener/Sequence. | |
int | loops [get, set] |
Number of times the Tweener/Sequence will run (-1 means the tween has infinite loops). | |
LoopType | loopType [get, set] |
Type of loop for this Tweener/Sequence, in case loops is greater than 1 (or infinite). | |
float | position [get, set] |
Gets and sets the time position of the Tweener/Sequence (loops are included when not infinite, delay is not). | |
float | duration [get] |
Duration of this Tweener/Sequence, loops and tween delay excluded. | |
float | fullDuration [get] |
Full duration of this Tweener/Sequence, loops included (when not infinite) but tween delay excluded. | |
float | elapsed [get] |
Elapsed time within the current loop (tween delay excluded). | |
float | fullElapsed [get] |
Full elapsed time including loops (but without considering tween delay). | |
UpdateType | updateType [get] |
The update type for this Tweener/Sequence. | |
int | completedLoops [get] |
Number of loops that have been executed. | |
bool | destroyed [get] |
Returns a value of true if this Tweener/Sequence was destroyed (either because it was manually destroyed, because it was completed, or because its target was destroyed). | |
bool | isEmpty [get] |
Returns a value of true if this Tweener/Sequence contains no tweens (if this is a tween, it means that no valid property to tween was set; if this is a sequence, it means no valid Tweener was yet added). | |
bool | isReversed [get] |
Returns a value of true if this Tweener/Sequence is set to go backwards (because of a call to Reverse . | |
bool | isLoopingBack [get] |
Returns a value of true when this Tweener/Sequence is in the "going backwards" part of a Yoyo loop. | |
bool | isPaused [get] |
Returns a value of true if this Tweener/Sequence is paused. | |
bool | hasStarted [get] |
Returns a value of true after this Tweener/Sequence was started the first time, or if a call to GoTo or GoToAndPlay was executed. | |
bool | isComplete [get] |
Returns a value of true when this Tweener/Sequence is complete. | |
bool | isSequenced [get] |
Returns a value of true if this Tweener/Sequence was added to a Sequence. |
Sequence component. Manager for sequence of Tweeners or other nested Sequences.
Author: Daniele Giardini (http://www.holoville.com)
Sequence | ( | SequenceParms | p_parms | ) |
Creates a new Sequence.
p_parms | A SequenceParms representing the Sequence parameters. You can pass an existing one, or create a new one inline via method chaining, like new SequenceParms().Id("sequence1").Loops(2).OnComplete(myFunction) |
float Append | ( | IHOTweenComponent | p_twMember | ) |
Adds the given IHOTweenComponent to the right of the sequence, and returns the new Sequence total time length (loops excluded).
p_twMember | The IHOTweenComponent to append. |
void AppendCallback | ( | TweenDelegate.TweenCallback | p_callback | ) |
Appends the given callback to this Sequence.
p_callback | The function to call, who must return void and accept no parameters |
void AppendCallback | ( | TweenDelegate.TweenCallbackWParms | p_callback, |
params object[] | p_callbackParms | ||
) |
Appends the given callback to this Sequence.
p_callback | The function to call. It must return void and has to accept a single parameter of type TweenEvent |
p_callbackParms | Additional comma separated parameters to pass to the function |
void AppendCallback | ( | GameObject | p_sendMessageTarget, |
string | p_methodName, | ||
object | p_value, | ||
SendMessageOptions | p_options = SendMessageOptions.RequireReceiver |
||
) |
Appends the given SendMessage callback to this Sequence.
p_sendMessageTarget | GameObject to target for sendMessage |
p_methodName | Name of the method to call |
p_value | Eventual additional parameter |
p_options | SendMessageOptions |
float AppendInterval | ( | float | p_duration | ) |
void ApplyCallback | ( | CallbackType | p_callbackType, |
TweenDelegate.TweenCallback | p_callback | ||
) | [inherited] |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type.
p_callbackType | The type of callback to apply |
p_callback | The function to call, who must return void and accept no parameters |
Implements IHOTweenComponent.
void ApplyCallback | ( | CallbackType | p_callbackType, |
TweenDelegate.TweenCallbackWParms | p_callback, | ||
params object[] | p_callbackParms | ||
) | [inherited] |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type.
p_callbackType | The type of callback to apply |
p_callback | The function to call. It must return void and has to accept a single parameter of type TweenEvent |
p_callbackParms | Additional comma separated parameters to pass to the function |
Implements IHOTweenComponent.
void ApplyCallback | ( | CallbackType | p_callbackType, |
GameObject | p_sendMessageTarget, | ||
string | p_methodName, | ||
object | p_value, | ||
SendMessageOptions | p_options = SendMessageOptions.RequireReceiver |
||
) | [inherited] |
Assigns the given callback to this Tweener/Sequence, overwriting any existing callbacks of the same type. This overload will use sendMessage to call the method named p_methodName on every MonoBehaviour in the p_sendMessageTarget GameObject.
p_callbackType | The type of callback to apply |
p_sendMessageTarget | GameObject to target for sendMessage |
p_methodName | Name of the method to call |
p_value | Eventual additional parameter |
p_options | SendMessageOptions |
void Clear | ( | SequenceParms | p_parms = null | ) |
void Complete | ( | ) | [inherited] |
Completes this Tweener/Sequence. Where a loop was involved, the Tweener/Sequence completes at the position where it would actually be after the set number of loops. If there were infinite loops, this method will have no effect.
Implements IHOTweenComponent.
List<Tweener> GetTweenersByTarget | ( | object | p_target | ) |
Returns a list of the eventual nested Tweener objects whose target is the given one, or an empty list if none was found.
override List<object> GetTweenTargets | ( | ) | [virtual] |
Returns a list of all the targets of this Sequence, or NULL if there are none.
Implements ABSTweenComponent.
bool GoTo | ( | float | p_time | ) | [inherited] |
Sends the Tweener/Sequence to the given time (taking also loops into account). If the time is bigger than the total Tweener/Sequence duration, it goes to the end.
p_time | The time where the Tweener/Sequence should be sent. |
true
if the Tweener/Sequence reached its end and was completed. Implements IHOTweenComponent.
bool GoTo | ( | float | p_time, |
bool | p_forceUpdate | ||
) | [inherited] |
Sends the Tweener/Sequence to the given time (taking also loops into account). If the time is bigger than the total Tweener/Sequence duration, it goes to the end.
p_time | The time where the Tweener/Sequence should be sent. |
p_forceUpdate | By default, if a Tweener/Sequence is already at the exact given time, it will not be refreshed. Setting this to true will force it to refresh (useful only if you want to be sure that any changes you made to the tweened property, outside of HOTween, are reset). |
true
if the Tweener/Sequence reached its end and was completed. bool GoToAndPlay | ( | float | p_time | ) | [inherited] |
Sends the Tweener/Sequence to the given time (taking also loops into account) and plays it. If the time is bigger than the total Tweener/Sequence duration, it goes to the end.
p_time | The time where the Tweener/Sequence should be sent. |
true
if the Tweener/Sequence reached its end and was completed. Implements IHOTweenComponent.
bool GoToAndPlay | ( | float | p_time, |
bool | p_forceUpdate | ||
) | [inherited] |
Sends the Tweener/Sequence to the given time (taking also loops into account) and plays it. If the time is bigger than the total Tweener/Sequence duration, it goes to the end.
p_time | The time where the Tweener/Sequence should be sent. |
p_forceUpdate | By default, if a Tweener/Sequence is already at the exact given time, it will not be refreshed. Setting this to true will force it to refresh (useful only if you want to be sure that any changes you made to the tweened property, outside of HOTween, are reset). |
true
if the Tweener/Sequence reached its end and was completed. float Insert | ( | float | p_time, |
IHOTweenComponent | p_twMember | ||
) |
Inserts the given IHOTweenComponent at the given time, and returns the new Sequence total time length (loops excluded).
p_time | The time at which the element must be placed. |
p_twMember | The IHOTweenComponent to insert. |
void InsertCallback | ( | float | p_time, |
TweenDelegate.TweenCallback | p_callback | ||
) |
Inserts the given callback at the given time position.
p_time | Time position where this callback will be placed (if longer than the whole sequence duration, the callback will never be called) |
p_callback | The function to call, who must return void and accept no parameters |
void InsertCallback | ( | float | p_time, |
TweenDelegate.TweenCallbackWParms | p_callback, | ||
params object[] | p_callbackParms | ||
) |
Inserts the given callback at the given time position.
p_time | Time position where this callback will be placed (if longer than the whole sequence duration, the callback will never be called) |
p_callback | The function to call. It must return void and has to accept a single parameter of type TweenEvent |
p_callbackParms | Additional comma separated parameters to pass to the function |
void InsertCallback | ( | float | p_time, |
GameObject | p_sendMessageTarget, | ||
string | p_methodName, | ||
object | p_value, | ||
SendMessageOptions | p_options = SendMessageOptions.RequireReceiver |
||
) |
Inserts the given SendMessage callback at the given time position.
p_time | Time position where this callback will be placed (if longer than the whole sequence duration, the callback will never be called) |
p_sendMessageTarget | GameObject to target for sendMessage |
p_methodName | Name of the method to call |
p_value | Eventual additional parameter |
p_options | SendMessageOptions |
override bool IsLinkedTo | ( | object | p_target | ) | [virtual] |
Returns true
if the given target is linked to a tween of this Sequence (running or not, taking into account also nested tweens).
p_target | The target to check. |
true
if the given target is linked to a tween of this Sequence (running or not, taking into account also nested tweens). Implements ABSTweenComponent.
override bool IsTweening | ( | object | p_target | ) | [virtual] |
Returns true
if the given target is currently involved in a running tween of this Sequence (taking into account also nested tweens). Returns false
both if the given target is not inside any of this Sequence tweens, than if the relative tween is paused. To simply check if the target is attached to a tween of this Sequence, use IsLinkedTo( target )
instead.
p_target | The target to check. |
Implements ABSTweenComponent.
override bool IsTweening | ( | string | p_id | ) | [virtual] |
Returns true
if the tween with the given string id is currently involved in a running tween or sequence.
p_id | The id to check for. |
Implements ABSTweenComponent.
override bool IsTweening | ( | int | p_id | ) | [virtual] |
Returns true
if the tween with the given int id is currently involved in a running tween or sequence.
p_id | The id to check for. |
Implements ABSTweenComponent.
void Kill | ( | ) | [inherited] |
Kills this Tweener/Sequence, removes it from HOTween, and cleans it.
Implements IHOTweenComponent.
void Pause | ( | ) | [inherited] |
Pauses this Tweener/Sequence.
Implements IHOTweenComponent.
void Play | ( | ) | [inherited] |
Resumes this Tweener/Sequence (tween delay included).
Implements IHOTweenComponent.
void PlayBackwards | ( | ) | [inherited] |
Resumes this Tweener/Sequence and plays it backwards.
Implements IHOTweenComponent.
void PlayForward | ( | ) | [inherited] |
Resumes this Tweener/Sequence (tween delay included) and plays it forward.
Implements IHOTweenComponent.
float Prepend | ( | IHOTweenComponent | p_twMember | ) |
Adds the given IHOTweenComponent to the left of the sequence, moving all the existing sequence elements to the right, and returns the new Sequence total time length (loops excluded).
p_twMember | The IHOTweenComponent to prepend. |
float PrependInterval | ( | float | p_duration | ) |
override void Restart | ( | ) | [virtual] |
Restarts this Sequence from the beginning (loops included).
Implements ABSTweenComponent.
void Reverse | ( | bool | p_forcePlay = false | ) | [inherited] |
Reverses this Tweener/Sequence, animating it backwards from its curren position.
p_forcePlay | If TRUE, the tween will also start playing in case it was paused, otherwise it will maintain its current play/pause state (default). |
Implements IHOTweenComponent.
override void Rewind | ( | ) | [virtual] |
Rewinds this Sequence (loops included), and pauses it.
Implements ABSTweenComponent.
IEnumerator WaitForCompletion | ( | ) | [inherited] |
A coroutine that waits until the Tweener/Sequence is complete (delays and loops included). You can use it inside a coroutine as a yield. Ex: yield return StartCoroutine( myTweenComponent.WaitForCompletion() );.
Implements IHOTweenComponent.
IEnumerator WaitForRewind | ( | ) | [inherited] |
A coroutine that waits until the Tweener/Sequence is rewinded (loops included). You can use it inside a coroutine as a yield. Ex: yield return StartCoroutine( myTweenComponent.WaitForRewind() );.
Implements IHOTweenComponent.
bool autoKillOnComplete [get, set, inherited] |
Default is true
, which means this Tweener/Sequence will be killed and removed from HOTween as soon as it's completed. If false
doesn't remove this Tweener/Sequence from HOTween when it is completed, and you will need to call an HOTween.Kill
to remove this Tweener/Sequence.
Implements IHOTweenComponent.
int completedLoops [get, inherited] |
Number of loops that have been executed.
Implements IHOTweenComponent.
bool destroyed [get, inherited] |
Returns a value of true
if this Tweener/Sequence was destroyed (either because it was manually destroyed, because it was completed, or because its target was destroyed).
float duration [get, inherited] |
Duration of this Tweener/Sequence, loops and tween delay excluded.
Implements IHOTweenComponent.
float elapsed [get, inherited] |
Elapsed time within the current loop (tween delay excluded).
Implements IHOTweenComponent.
bool enabled [get, set, inherited] |
Default is true
. If set to false
, this Tweener/Sequence will not be updated, and any use of animation methods (Play/Pause/Rewind/etc) will be ignored (both if called directly via this instance, than if using HOTween.Play/Pause/Rewind/etc.).
Implements IHOTweenComponent.
float fullDuration [get, inherited] |
Full duration of this Tweener/Sequence, loops included (when not infinite) but tween delay excluded.
Implements IHOTweenComponent.
float fullElapsed [get, inherited] |
Full elapsed time including loops (but without considering tween delay).
Implements IHOTweenComponent.
bool hasStarted [get, inherited] |
Returns a value of true
after this Tweener/Sequence was started the first time, or if a call to GoTo
or GoToAndPlay
was executed.
Implements IHOTweenComponent.
string id [get, set, inherited] |
Eventual string ID of this Tweener/Sequence (more than one Tweener/Sequence can share the same ID, thus allowing for grouped operations). You can also use intId
instead of id
for faster operations.
Implements IHOTweenComponent.
int intId [get, set, inherited] |
Eventual int ID of this Tweener/Sequence (more than one Tweener/Sequence can share the same intId, thus allowing for grouped operations). The main difference from id
is that while id
is more legible, intId
allows for faster operations.
Implements IHOTweenComponent.
bool isComplete [get, inherited] |
Returns a value of true
when this Tweener/Sequence is complete.
Implements IHOTweenComponent.
bool isEmpty [get, inherited] |
Returns a value of true
if this Tweener/Sequence contains no tweens (if this is a tween, it means that no valid property to tween was set; if this is a sequence, it means no valid Tweener was yet added).
Implements IHOTweenComponent.
bool isLoopingBack [get, inherited] |
Returns a value of true
when this Tweener/Sequence is in the "going backwards" part of a Yoyo loop.
Implements IHOTweenComponent.
bool isPaused [get, inherited] |
Returns a value of true
if this Tweener/Sequence is paused.
Implements IHOTweenComponent.
bool isReversed [get, inherited] |
Returns a value of true
if this Tweener/Sequence is set to go backwards (because of a call to Reverse
.
Implements IHOTweenComponent.
bool isSequenced [get, inherited] |
Returns a value of true
if this Tweener/Sequence was added to a Sequence.
Implements IHOTweenComponent.
int loops [get, set, inherited] |
Number of times the Tweener/Sequence will run (-1
means the tween has infinite loops).
Implements IHOTweenComponent.
Type of loop for this Tweener/Sequence, in case loops is greater than 1 (or infinite).
Implements IHOTweenComponent.
float position [get, set, inherited] |
Gets and sets the time position of the Tweener/Sequence (loops are included when not infinite, delay is not).
Implements IHOTweenComponent.
float timeScale [get, set, inherited] |
Time scale that will be used by this Tweener/Sequence.
Implements IHOTweenComponent.
UpdateType updateType [get, inherited] |
The update type for this Tweener/Sequence.
Implements IHOTweenComponent.