![]() |
TilePlus Version 5
Unity3D Tilemap Extension
|
Tweener/Sequencer Scriptable Runtime Service (SRS) More...


Public Types | |
| enum | EaseTarget { Position , Rotation , Scale , Color , ColorConstantA , Delay , Matrix , MatrixColor , MatrixColorConstantA , UserDefined } |
| What to ease. More... | |
| enum | GameObjTweenEaseTarget { Position , Rotation , Scale , Color } |
| Ease Target for GameObjectTweens. More... | |
| enum | LoopType { None , Loop , PingPong } |
| Type of looping (or none) More... | |
| enum | MatrixHints { None = 0 , NoScaling = 1 , NoRotation = 2 , NoPosition = 4 } |
| Allows fine control over how MATRIX-style tweens work Note that if all the flags are true then nothing happens. More... | |
Public Member Functions | |
| long | GameObjectPositionBezierTween (GameObject go, Vector3[] points, float duration, long sequenceId=0L, LoopType loopType=LoopType.None, int numLoops=-1, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| Tween a GameObject's position along a Bezier curve along a set of points. | |
| override void | OnDisable () |
| Unity event method. | |
| override void | OnEnable () |
| OnEnable. | |
| override string | Status () |
| Status string. | |
| override string | Details (int length=-1) |
The SRS inspector utility will show whatever this returns.
| |
| override bool | CanPollForDetails () |
Used by SRS inspector. If the contents of an SRS change frequently then this should be overridden to return true.
| |
| long | CreateTween (TilePlusBase tpb, Vector3 endValue, Color endColor, Matrix4x4 endMatrix, TpEasingFunction.Ease ease, EaseTarget easeTarget, float duration, long sequenceId=0L, LoopType loopType=LoopType.None, int numLoops=-1, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null, MatrixHints matrixHints=MatrixHints.None, TpEasingFunction.Ease? matrixRotEase=null, TpEasingFunction.Ease? matrixScaleEase=null) |
| Create a tween for tile transforms, runs immediately. | |
| long | CreateTweenFromSpec (TilePlusBase tpb, TpTweenSpec.Tween tweenSpec, long sequenceId=0L, float timeScale=0f, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| Play a tween using a TpTweenSpec.TweenItem as the template. | |
| long | CreateGoTweenFromSpec (GameObject go, TpGoTweenSpec.GoTween goTweenSpec, long sequenceId=0L, float timeScale=0f, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| Create a GameObject tween from a GoTweenSpec asset. | |
| long | CreateDelayTween (float duration, long sequenceId) |
| Create a Delay tween. Use to obtain and add a Delay to a sequence. | |
| long | CreateGoTween (GameObject? gameObject, Action< TpTween, float >? gameObjectAction, TpEasingFunction.Ease ease, float duration, long sequenceId=0L, LoopType loopType=LoopType.None, int numLoops=-1, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| Create a tween for GameObjects, runs immediately. Note that you should normally use GameObjectColor and GameObjectTrs which are wrappers for this method but less customizable. | |
| TpTween? | GetTween (long id) |
| Get a tween instance. This is a live, running tween. | |
| TpTween? | GetTweenFromSequence (long sequenceId, long tweenId) |
| Get a tween with ID from sequence with an Id. | |
| string | GetTweenInfo (long id) |
| Get the ToString of an ACTIVE tween without retrieving the instance. | |
| bool | KillTween (long id) |
| Kill an ACTIVE tween with a given ID and return the instance to the pool. | |
| bool | IsRunningTween (long id) |
| Is a tween with given ID running. | |
| TpTween? | CopyTweener (long id) |
| Get a copy of a tween for diagnostics. | |
| long | CreateSequence (string sName, int size=2, int numLoops=0, bool isGameObjectSequence=false, Action< TpTweenSequence, bool >? onFinished=null, Action< TpTweenSequence, TpTween >? onNextTween=null) |
| Create an empty sequence and add it to the PendingSequences dictionary. Retrieve it with GetSequence and populate it with one of the three Create methods, passing in the sequence ID, then use PlaySequence. | |
| long | CreateSequenceFromSpec (TilePlusBase tpb, TpTweenSpec tweenSpec, int[]? indices=null, int numLoops=0, Action< TpTweenSequence, bool >? onFinished=null, Action< TpTweenSequence, TpTween >? onNextTween=null, float timeScale=0f) |
| Create a sequence from a TpTweenSpec. Uses ALL tweens in the list. | |
| long | CreateSequenceFromGoSpec (TpGoTweenSpec goTweenSpec, GameObject go, int[]? indices=null, int numLoops=0, Action< TpTweenSequence, bool >? onFinished=null, Action< TpTweenSequence, TpTween >? onNextTween=null, float timeScale=0f) |
| Create a sequence from a TpTweenSpec. Uses ALL tweens in the list. | |
| bool | PlaySequence (TilePlusBase? parent, long sequenceId) |
| Play a sequence. | |
| bool | KillRunningSequence (long sequenceId) |
| Kill a running sequence given it's sequenceId. | |
| bool | DeletePendingSequence (long sequenceId) |
| Delete sequence from pending sequences. | |
| string | GetSequenceInfo (long id) |
| Get the ToString of a sequence without retrieving the instance. | |
| void | ResetSequencer () |
| Reset the sequencer. | |
| void | ResetTweener (bool complete=false) |
| Partial or complete reset of Tweener. | |
| void | GetInfoOnAllRunningTweens (ref List< string > info, int max) |
| Get the ToString of all running tweens. | |
| void | GetInfoOnAllRunningSequences (ref List< string > info, int max) |
| Ge the ToString for all running sequences. | |
| bool | HasSequenceForTile (TilePlusBase tile, bool both=true) |
| Is there a running and/or pending sequence for this tile? | |
| bool | HasRunningTweenForTile (TilePlusBase tile) |
| Is there a running tween for this tile? | |
| bool | HasAnyRunningTweenForTiles (TilePlusBase[] tiles) |
| Is there a running tweens for ANY tile in an array of tiles. Use infrequently, is inefficient (creates ~256 bytes GC). | |
| Awaitable? | TweenAsAwaitable (long id) |
| Convenience method: return a tween as an Awaitable<bool>. | |
| Awaitable? | PendingSequenceAsAwaitable (long id) |
| Convenience method: return a PENDING sequence as as an Awaitable<bool>. | |
| long | GameObjectTrs (GameObjTweenEaseTarget easeTarget, GameObject go, Vector3? startValue, Vector3 endValue, float duration, TpEasingFunction.Ease ease, Action< TpTween, float >? customGameObjectAction=null, long sequenceId=0L, LoopType loopType=LoopType.None, int numLoops=-1, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| TRS (Translation, Rotation, Scale) a GameObject. | |
| long | GameObjectColor (GameObject go, Color? startValue, Color endValue, float duration, TpEasingFunction.Ease ease, long sequenceId=0L, LoopType loopType=LoopType.None, int numLoops=-1, Action< TpTween >? onFinished=null, Action< TpTween, float >? onRewindOrPingPong=null, Action< TpTween >? onLoopEnded=null, Action< TpTween, float >? onUpdate=null) |
| Tween Color for a sprite renderer. | |
| Public Member Functions inherited from TilePlus.ScriptableRuntimeService< T > | |
| override string | ToString () |
| Customize ToString in overrides. | |
| Public Member Functions inherited from TilePlus.IScriptableService | |
| void | MessageTarget (ObjectPacket packet) |
| If Accepts messages is true, reimplement this to get messaged. | |
Properties | |
| bool | HasTweensOrSequences [get] |
| Are there any active tweens or sequences? | |
| int | NumActiveTweens [get] |
| How many tweens? | |
| int | NumActiveSequences [get] |
| How many active sequences? | |
| bool | Diagnostics = false [get, set] |
| Adds additional checks for invalid/insane tweens. | |
| bool | SafeMode = true [get, set] |
| If true, tweens are checked for 'Sanity' before use. 'Sanity' means that the tile parent isn't null and its map isn't null. Setting this false can increase performance if you have many tweens. | |
| Properties inherited from TilePlus.ScriptableRuntimeService< T > | |
| string | ServiceName [get] |
| A name for this service: used for profiling. Ordinarily just returns the 'name' property of the Service S.O. instance. | |
| Properties inherited from TilePlus.IScriptableService | |
| bool | PeristThruReload [get] |
| If true, this will not be deleted when the Unity scene changes. | |
| string[] | AcceptableMessages [get] |
| If true, can accept ObjectPacket messages from the Service Manager with command-strings matching those returned here. | |
Additional Inherited Members | |
| Static Protected Member Functions inherited from TilePlus.ScriptableRuntimeService< T > | |
| static void | Create () |
| Create and initialize method. | |
Tweener/Sequencer Scriptable Runtime Service (SRS)
How to use:
– Obtain a handle using TpServiceManager or use the protected static TpTweener TweenerService method within any TPT tile code.
– Create a tween using CreateTween, CreateDelayTween, CreateGoTween, or CreateTweenFromSpec. This returns a lookup ID for the tween. The tween runs immediately. Use this ID to kill the tween.
– Create a sequence using CreateSequence. An ID for this paused sequence is returned. Then add to the sequence using one of the Create methods above, supplying the sequence ID. The tween(s) are added to the sequence and do not run until the the sequence begins to run by your use of PlaySequence. Created but un-played sequences can be removed with DeletePendingSequence (Optional, edge case situation). Playing sequences can be killed with KillRunningSequence, which optionally can kill whatever tween is running. If a sequence is running and becomes invalid (i.e., its tile becomes null or its parent Tilemap becomes null, etc) it's auto-deleted.
– NOTE THAT when you request an empty sequence it's internally tagged for Tile tweens or GameObject tweens. – Adding Tile tweens to a GameObject-tagged sequence or vice versa is an error.
There are several tweening 'Targets' : Position, Rotation (Z only), Scale (x,y only), Color, and Delay. Delay is for use in sequences to add a delay between tweens.
There's no optional delay when starting a tween. If you need one just create a two-item sequence with the first item being a Delay tween and the second one with a Position, etc Target.
What to ease.
| Enumerator | |
|---|---|
| Position | Tile sprite position. |
| Rotation | Tile sprite rotation. |
| Scale | Tile sprite scale. |
| Color | Tile sprite color. |
| ColorConstantA | Tile sprite color, alpha always fkept at the starting value. |
| Delay | NO tweening: instead, marks this as a DELAY in a TpTweenSequence. If this is used when starting a tween any other way the tween creation function will return 0, which indicates an error. TpTweenSequence |
| Matrix | Tweens a raw Matrix4x4 as separate Scale, Position, Rotation tweens. Use if you want to tween any two of these in the same tween. |
| MatrixColor | Matrix and Color. Change everything with one tween. |
| MatrixColorConstantA | Matrix and Color, with Alpha kept at the starting value. |
| UserDefined | User-defined tween evaluation. |
|
virtual |
Used by SRS inspector. If the contents of an SRS change frequently then this should be overridden to return true.
Reimplemented from TilePlus.ScriptableRuntimeService< T >.
| TpTween? TilePlus.TpTweener.CopyTweener | ( | long | id | ) |
Get a copy of a tween for diagnostics.
| id | the ID |
Good for troubleshooting, this is an UNPOOLED instance.
| long TilePlus.TpTweener.CreateDelayTween | ( | float | duration, |
| long | sequenceId ) |
Create a Delay tween. Use to obtain and add a Delay to a sequence.
| duration | delay time |
| sequenceId | REQUIRED. 0 will create a warning and the DELAY won't be created. |
| long TilePlus.TpTweener.CreateGoTween | ( | GameObject? | gameObject, |
| Action< TpTween, float >? | gameObjectAction, | ||
| TpEasingFunction.Ease | ease, | ||
| float | duration, | ||
| long | sequenceId = 0L, | ||
| LoopType | loopType = LoopType::None, | ||
| int | numLoops = -1, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
Create a tween for GameObjects, runs immediately. Note that you should normally use GameObjectColor and GameObjectTrs which are wrappers for this method but less customizable.
| gameObject | the target GameObject. |
| gameObjectAction | An Action to update the gameObj somehow. Gets tween and progress. DONT MODIFY THE TWEEN INSTANCE!! |
| ease | A value from the TpEasingFunction.Ease enum. |
| duration | time for the tween to complete. |
| sequenceId | if not 0, the tween is added to the sequence and NOT played. |
| loopType | None, Loop, PingPong |
| numLoops | How many loops if loopType isn't 'None'. If loop type is ping-pong this number is internally doubled. |
| onFinished | callback when tween completes |
| onRewindOrPingPong | callback on rewind or pingpong |
| onLoopEnded | callback when loop ended |
| onUpdate | callback on Update FOR EACH TWEEN |
OnFinished, OnRewindOrPingPong, OnLoopEnded pass the TpTween instance. Do not keep it! For OnFinished/OnLoopEnded the instance is very quickly reset and returned to the pool so its contents will NOT be valid after the callback returns to this Service.
| long TilePlus.TpTweener.CreateGoTweenFromSpec | ( | GameObject | go, |
| TpGoTweenSpec.GoTween | goTweenSpec, | ||
| long | sequenceId = 0L, | ||
| float | timeScale = 0f, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
Create a GameObject tween from a GoTweenSpec asset.
| go | target GameObject |
| goTweenSpec | spec list |
| sequenceId | sequence ID or 0 |
| timeScale | scale duration |
| onFinished | onFinished callback |
| onRewindOrPingPong | OnRewindOrPingPong callback |
| onLoopEnded | OnLoopEnded callback |
| onUpdate | callback every update |
| long TilePlus.TpTweener.CreateSequence | ( | string | sName, |
| int | size = 2, | ||
| int | numLoops = 0, | ||
| bool | isGameObjectSequence = false, | ||
| Action< TpTweenSequence, bool >? | onFinished = null, | ||
| Action< TpTweenSequence, TpTween >? | onNextTween = null ) |
Create an empty sequence and add it to the PendingSequences dictionary. Retrieve it with GetSequence and populate it with one of the three Create methods, passing in the sequence ID, then use PlaySequence.
| sName | Name for the sequence. Typ use Tile's name. |
| size | inital size of the internal list of tweens used by this sequence |
| numLoops | Number of times this sequence repeats. 0 OR 1 means it only plays once. -1 plays until killed |
| isGameObjectSequence | set true if you will use this sequence for GameObject tweens |
| onFinished | callback when the sequence is complete. a bool sent to the callback is true for an actual completion or false if the sequence is complete but will repeat. |
| onNextTween | callback when the next tween is about to start. Note: could be a 'delay' tween; one with EaseTarget = Delay. EaseTarget |
If a tween is Loop or PingPong and the #loops is -1 (infinite) then that tween is discarded and a warning is sent to the console.
Note that sequence elements that have the DELAY EaseTarget can be used to have delays between actual tweens.
If numLoops is > 0 then the tweens are NOT returned to the pool until all loops have completed or the sequence is deleted with KillRunningSequence.
| long TilePlus.TpTweener.CreateSequenceFromGoSpec | ( | TpGoTweenSpec | goTweenSpec, |
| GameObject | go, | ||
| int?[] | indices = null, | ||
| int | numLoops = 0, | ||
| Action< TpTweenSequence, bool >? | onFinished = null, | ||
| Action< TpTweenSequence, TpTween >? | onNextTween = null, | ||
| float | timeScale = 0f ) |
Create a sequence from a TpTweenSpec. Uses ALL tweens in the list.
| go | GameObject |
| goTweenSpec | Tween spec list |
| indices | an array of indices into the Tween spec list. If not null, this array of indices is used to choose tweens (in the order you specify) in a sequence. If null, ALL of the items in the tweenSpec are used. If an index is out of range then it is silently ignored. |
| numLoops | How many loops this sequence should make |
| onFinished | OnFinished callback |
| onNextTween | OnNextTween callback |
| timeScale | if positive and nonzero, all of the sequence's tweens durations are scaled. For example, 0.5 would slow down and 1.5 would speed up |
| long TilePlus.TpTweener.CreateSequenceFromSpec | ( | TilePlusBase | tpb, |
| TpTweenSpec | tweenSpec, | ||
| int?[] | indices = null, | ||
| int | numLoops = 0, | ||
| Action< TpTweenSequence, bool >? | onFinished = null, | ||
| Action< TpTweenSequence, TpTween >? | onNextTween = null, | ||
| float | timeScale = 0f ) |
Create a sequence from a TpTweenSpec. Uses ALL tweens in the list.
| tpb | Parent tile |
| tweenSpec | Tween spec list |
| indices | an array of indices into the Tween spec list. If not null, this array of indices is used to choose tweens (in the order you specify) in a sequence. If null, ALL of the items in the tweenSpec are used. If an index is out of range then it is silently ignored. |
| numLoops | How many loops this sequence should make |
| onFinished | OnFinished callback |
| onNextTween | OnNextTween callback |
| timeScale | if positive and nonzero, all of the sequence's tweens durations are scaled. For example, 0.5 would slow down and 1.5 would speed up |
| long TilePlus.TpTweener.CreateTween | ( | TilePlusBase | tpb, |
| Vector3 | endValue, | ||
| Color | endColor, | ||
| Matrix4x4 | endMatrix, | ||
| TpEasingFunction.Ease | ease, | ||
| EaseTarget | easeTarget, | ||
| float | duration, | ||
| long | sequenceId = 0L, | ||
| LoopType | loopType = LoopType::None, | ||
| int | numLoops = -1, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null, | ||
| MatrixHints | matrixHints = MatrixHints::None, | ||
| TpEasingFunction.Ease? | matrixRotEase = null, | ||
| TpEasingFunction.Ease? | matrixScaleEase = null ) |
Create a tween for tile transforms, runs immediately.
| tpb | the calling tile's instance (usu. 'this'). |
| endValue | The final RELATIVE value for the tween. The start value is taken from the current tile-sprite's transform in the Tilemap. |
| endColor | the final value for the tween when EaseTarget is Color or MatrixColor |
| endMatrix | the final value for the tween when EaseTarget is Matrix |
| ease | A value from the TpEasingFunction.Ease enum. |
| easeTarget | EaseTarget.Position, .Rotation, or .Scale |
| duration | time for the tween to complete. Doubled when loop=pingpong See remarks. |
| sequenceId | if not 0, the tween is added to the sequence and NOT played. |
| loopType | None, Loop, PingPong |
| numLoops | How many loops if loopType isn't 'None'. If loop type is ping-pong this number is internally doubled. |
| onFinished | callback when tween completes |
| onRewindOrPingPong | callback on rewind or pingpong |
| onLoopEnded | callback when loop ended |
| onUpdate | callback on Update FOR EACH TWEEN |
| matrixHints | optional FLAGS enum used with Matrix tweens. Allows only tweening certain parts of the matrix. |
| matrixRotEase | Optional Rotation ease function. If null, use 'ease' |
| matrixScaleEase | Optional Scale ease function. If null, use 'ease' |
If a tween is Ping-Pong looping then the duration is doubled. IE, the duration is 2 then ping duration is 2 and pong direction is 2.
Note that the OnUpdate callback DOES occur in builds. BUT it's not advised to use it frivolously, as it will update at the frame rate (Fixed Update timing) for EACH TWEEN; in other words, if you have 30 tweens running you'll get 30 callbacks EVERY frame.
OnFinished, OnRewindOrPingPong, OnLoopEnded, and OnUpdate pass the TpTween instance. Do not keep it! For OnFinished/OnLoopEnded the instance is very quickly reset and returned to the pool so its contents will NOT be valid after the callback returns to this Service.
It's important to note that the 'end' values are relative. So for example,if you specify a position tween with an endvalue of new Vector3(2,2,1) the position of the sprite moves two units in X and 2 units in Y and NOT to the absolute world position (2,2,1).
| long TilePlus.TpTweener.CreateTweenFromSpec | ( | TilePlusBase | tpb, |
| TpTweenSpec.Tween | tweenSpec, | ||
| long | sequenceId = 0L, | ||
| float | timeScale = 0f, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
Play a tween using a TpTweenSpec.TweenItem as the template.
| tpb | Tile to tween |
| tweenSpec | the spec |
| sequenceId | if not 0, the tween is added to the sequence and NOT played. |
| onFinished | OnFinished callback |
| onRewindOrPingPong | OnRewindOrPingPong callback |
| onLoopEnded | OnLoopEnded callback |
| onUpdate | OnUpdate callback (disabled in builds!) |
| timeScale | if positive and nonzero, all of the sequence's tweens durations are scaled. For example, 0.5 would slow down and 1.5 would speed up |
| bool TilePlus.TpTweener.DeletePendingSequence | ( | long | sequenceId | ) |
Delete sequence from pending sequences.
| sequenceId | ID |
|
virtual |
The SRS inspector utility will show whatever this returns.
Reimplemented from TilePlus.ScriptableRuntimeService< T >.
| long TilePlus.TpTweener.GameObjectColor | ( | GameObject | go, |
| Color? | startValue, | ||
| Color | endValue, | ||
| float | duration, | ||
| TpEasingFunction.Ease | ease, | ||
| long | sequenceId = 0L, | ||
| LoopType | loopType = LoopType::None, | ||
| int | numLoops = -1, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
Tween Color for a sprite renderer.
| go | Target Game Object |
| startValue | Start value for position (is NULLABLE, if null passed-in then the current position is used. |
| endValue | End position. |
| duration | Duration of the tween |
| ease | Ease function |
| sequenceId | If adding to a sequence provide this number obtained from CreateSequence. 0L means no sequence. Using arbitrary sequence ID or one that's running is an error. |
| loopType | Single, loop, pingpong |
| numLoops | how many loops, -1 = forever |
| onFinished | Callback when complete (hijacked when part of a sequence). |
| onRewindOrPingPong | Callback for rewind loop or pingpong (hijacked when part of a sequence> |
| onLoopEnded | Callback for end of loop (hijacked when part of a sequence) |
| onUpdate | Callback EVERY update. Avoid if possible. |
NOTE THAT unlike tile tweens, the start and end values are NOT relative to the current position. If you do not provide a startValue (pass-in null) then the current position is used as the starting position. If you DO provide a startValue and it ISN'T the current position then the GameObject will initially jump to that position. Note: rotation performed via Eulerangles
| long TilePlus.TpTweener.GameObjectPositionBezierTween | ( | GameObject | go, |
| Vector3[] | points, | ||
| float | duration, | ||
| long | sequenceId = 0L, | ||
| LoopType | loopType = LoopType::None, | ||
| int | numLoops = -1, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
Tween a GameObject's position along a Bezier curve along a set of points.
| go | GameObject |
| points | array of points. Note that size must be between 2 and 16. |
| duration | elapsed time |
| sequenceId | 0L if not in a sequence, or a sequence ID from CreateSequence. |
| loopType | Single, loop, pingpong |
| numLoops | how many loops, -1 = forever |
| onFinished | Callback when complete (hijacked when part of a sequence). |
| onRewindOrPingPong | Callback for rewind loop or pingpong (hijacked when part of a sequence> |
| onLoopEnded | Callback for end of loop (hijacked when part of a sequence) |
| onUpdate | Callback EVERY update. Avoid if possible. |
The tween ID. TWEEN BEGINS IMMEDIATELY unless part of a sequence.
points[0] is the start position, GO will jump there if not already at that spot. Position[n-1] is the end position.
| long TilePlus.TpTweener.GameObjectTrs | ( | GameObjTweenEaseTarget | easeTarget, |
| GameObject | go, | ||
| Vector3? | startValue, | ||
| Vector3 | endValue, | ||
| float | duration, | ||
| TpEasingFunction.Ease | ease, | ||
| Action< TpTween, float >? | customGameObjectAction = null, | ||
| long | sequenceId = 0L, | ||
| LoopType | loopType = LoopType::None, | ||
| int | numLoops = -1, | ||
| Action< TpTween >? | onFinished = null, | ||
| Action< TpTween, float >? | onRewindOrPingPong = null, | ||
| Action< TpTween >? | onLoopEnded = null, | ||
| Action< TpTween, float >? | onUpdate = null ) |
TRS (Translation, Rotation, Scale) a GameObject.
| easeTarget | Indicate Translation, Rotation, or Scale |
| go | Target Game Object |
| startValue | Start value: is NULLABLE, if null passed-in then the current Position/Rotation/Scale is used. |
| endValue | End position, rotation, scale. |
| duration | Duration of the tween |
| ease | Ease function |
| customGameObjectAction | A custom action to be used instead of the built-in Actions for position, rotation, and scale. |
| sequenceId | If adding to a sequence provide this number obtained from CreateSequence. 0L means no sequence. Using arbitrary sequence ID or one that's running is an error. |
| loopType | Single, loop, pingpong |
| numLoops | how many loops, -1 = forever |
| onFinished | Callback when complete (hijacked when part of a sequence). |
| onRewindOrPingPong | Callback for rewind loop or pingpong (hijacked when part of a sequence> |
| onLoopEnded | Callback for end of loop (hijacked when part of a sequence) |
| onUpdate | Callback EVERY update. Avoid if possible. |
For these Vector3-type tweens, if the startValue is null then you're requesting a 'relative' tween. What this means: the startValue is taken from the GameObject's transform position, rotation, or scale, and is added to the endValue. Hence, the tween is from, say, tranform.position to endValue+transform.position. If startValue is NOT null, then this is an 'absolute' tween, and the tween is from startValue to endValue.
If you DO provide a startValue and it ISN'T the current position/rotation/scale then the GameObject will initially jump to that position/rotation/scale. Note: rotation performed via Eulerangles, scale uses localScale. – the customGameObjectAction is used as a substitute for the built-in Actions for Position, Rotation, or Scale. – For example, one could evaluate a Bezier curve (for Position transforms) or just about anything else.
| void TilePlus.TpTweener.GetInfoOnAllRunningSequences | ( | ref List< string > | info, |
| int | max ) |
Ge the ToString for all running sequences.
| info | Output list |
| max | limit |
| void TilePlus.TpTweener.GetInfoOnAllRunningTweens | ( | ref List< string > | info, |
| int | max ) |
Get the ToString of all running tweens.
| info | List of strings to put info into |
| max | limit on # of strings |
| string TilePlus.TpTweener.GetSequenceInfo | ( | long | id | ) |
Get the ToString of a sequence without retrieving the instance.
| id | ID of the sequence |
| TpTween? TilePlus.TpTweener.GetTween | ( | long | id | ) |
Get a tween instance. This is a live, running tween.
| id | ID of the tween. |
To avoid memory leaks, don't hold an instance of the returned value outside of a method scope. See: CopyTweener and GetTweenInfo. Note that this is ONLY running tweens. To obtain a tween that's in a sequence use GetTweenFromSequence
| TpTween? TilePlus.TpTweener.GetTweenFromSequence | ( | long | sequenceId, |
| long | tweenId ) |
Get a tween with ID from sequence with an Id.
| sequenceId | Id of the sequence |
| tweenId | Id of the tweener |
| string TilePlus.TpTweener.GetTweenInfo | ( | long | id | ) |
Get the ToString of an ACTIVE tween without retrieving the instance.
| id | ID of the tween |
| bool TilePlus.TpTweener.HasAnyRunningTweenForTiles | ( | TilePlusBase[] | tiles | ) |
Is there a running tweens for ANY tile in an array of tiles. Use infrequently, is inefficient (creates ~256 bytes GC).
| tiles | array of tiles |
| bool TilePlus.TpTweener.HasRunningTweenForTile | ( | TilePlusBase | tile | ) |
Is there a running tween for this tile?
| tile | tile to test |
| bool TilePlus.TpTweener.HasSequenceForTile | ( | TilePlusBase | tile, |
| bool | both = true ) |
Is there a running and/or pending sequence for this tile?
| tile | tile to test |
| both | if false, just checks running sequences and NOT pending ones. |
| bool TilePlus.TpTweener.IsRunningTween | ( | long | id | ) |
Is a tween with given ID running.
| id |
| bool TilePlus.TpTweener.KillRunningSequence | ( | long | sequenceId | ) |
Kill a running sequence given it's sequenceId.
| sequenceId | ID |
| bool TilePlus.TpTweener.KillTween | ( | long | id | ) |
Kill an ACTIVE tween with a given ID and return the instance to the pool.
| id | ID of the tween as returned by QueueTransformTween |
The tween is released at the next Update.
|
virtual |
Unity event method.
Reimplemented from TilePlus.ScriptableRuntimeService< T >.
|
virtual |
OnEnable.
Reimplemented from TilePlus.ScriptableRuntimeService< T >.
| Awaitable? TilePlus.TpTweener.PendingSequenceAsAwaitable | ( | long | id | ) |
Convenience method: return a PENDING sequence as as an Awaitable<bool>.
| id | ID of sequence. MUST BE A PENDING, NOT RUNNING, SEQUENCE. |
There's no way to make a running sequence awaitable. NOTE THAT this will await on either the sequence being PENDING or PLAYING. That way you can create a sequence, make it awaitable, then launch it.
| bool TilePlus.TpTweener.PlaySequence | ( | TilePlusBase? | parent, |
| long | sequenceId ) |
Play a sequence.
| parent | Parent tile for this sequence. |
| sequenceId | The sequence to play. Must already have been created by CreateSequence. |
Note that onRewindOrPingPong and OnUpdate callbacks from the tween are not used.
| void TilePlus.TpTweener.ResetSequencer | ( | ) |
Reset the sequencer.
| void TilePlus.TpTweener.ResetTweener | ( | bool | complete = false | ) |
Partial or complete reset of Tweener.
| complete | Complete reset means clearing the starting ID, clearing all tweens and releasing all tweens from the pooler. Normally you don't want to do that so leave it false. |
|
virtual |
| Awaitable? TilePlus.TpTweener.TweenAsAwaitable | ( | long | id | ) |
Convenience method: return a tween as an Awaitable<bool>.
| id | ID of tween. |
|
getset |
Adds additional checks for invalid/insane tweens.
Use TpLibInit to set this at runtime, however that can be overridden at any time.
|
get |
Are there any active tweens or sequences?
|
get |
How many active sequences?
|
get |
How many tweens?
|
getset |
If true, tweens are checked for 'Sanity' before use. 'Sanity' means that the tile parent isn't null and its map isn't null. Setting this false can increase performance if you have many tweens.