Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LitMotion v2.0 #138

Merged
merged 272 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
61c155e
Move: BindToProgress to LitMotion.Extensions
yn01-dev Nov 21, 2024
68c164f
Merge pull request #142 from AnnulusGames/move-bind-extensions
yn01-dev Nov 21, 2024
77e894b
Revert: multiple state
yn01-dev Nov 22, 2024
d41b3d9
Add: Box
yn01-dev Nov 22, 2024
5d274a4
Add: Bind overload (function pointer)
yn01-dev Nov 22, 2024
2a4fc29
Optimize: Bind with struct state
yn01-dev Nov 22, 2024
4092c23
Update: benchmark
yn01-dev Nov 22, 2024
1daf24a
Update: benchmark
yn01-dev Nov 22, 2024
8798861
Update: benchmark
yn01-dev Nov 22, 2024
2451dc4
Merge pull request #143 from AnnulusGames/optimize-bind-state
yn01-dev Nov 22, 2024
2133966
Add: TryComplete/TryCancel
yn01-dev Nov 22, 2024
f3c2699
Fix: error message
yn01-dev Nov 22, 2024
bfd161f
Improve: better error message
yn01-dev Nov 23, 2024
980fd71
Remove: unnecessary field
yn01-dev Nov 23, 2024
154d48d
Merge pull request #144 from AnnulusGames/add-trycancelcomplete
yn01-dev Nov 23, 2024
f67f748
Add: LoopType.Flip and change LoopType.Yoyo behavior
yn01-dev Nov 23, 2024
d4f0b26
Add: sandbox
yn01-dev Nov 23, 2024
7ef5ff3
Merge pull request #145 from AnnulusGames/looptype-flip
yn01-dev Nov 23, 2024
8c4d383
Add: MotionHandle.Time
yn01-dev Nov 23, 2024
7e4e784
Remove: PlaybackSpeed check
yn01-dev Nov 23, 2024
71bbf99
Change: MotionHelper.Update -> SetTime
yn01-dev Nov 23, 2024
94dbbd2
Add: MotionHandle.Preserve()
yn01-dev Nov 23, 2024
4e1bb83
Refactoring
yn01-dev Nov 23, 2024
a5d3994
Fix: bug when time > totalDuration
yn01-dev Nov 23, 2024
8a623e5
Fix: IsPreserved is not initialized
yn01-dev Nov 23, 2024
769feba
Update: tests
yn01-dev Nov 23, 2024
b0295f9
Revert "Remove: PlaybackSpeed check"
yn01-dev Nov 23, 2024
ddd00f6
Fix: OnComplete is called every frame after completion
yn01-dev Nov 23, 2024
c8e935c
Fix: TryCompleteCore
yn01-dev Nov 23, 2024
46bedd5
Merge pull request #146 from AnnulusGames/add-motionhandle-time-property
yn01-dev Nov 23, 2024
730833b
Change: allow negative values ​​for PlaybackSpeed
yn01-dev Nov 23, 2024
86e16c2
Merge pull request #147 from AnnulusGames/allow-negative-playbackspeed
yn01-dev Nov 23, 2024
f864caa
Fix: UpdateRunner.Reset
yn01-dev Nov 23, 2024
924d3ae
Merge pull request #148 from AnnulusGames/fix-updaterunner
yn01-dev Nov 23, 2024
3ea767e
Add: MotionSettings / SerializableMotionSettings
yn01-dev Nov 23, 2024
8e0c64c
Change: MotionSettings to immutable
yn01-dev Nov 24, 2024
310f0b3
Add: public API
yn01-dev Nov 24, 2024
f4e9a8d
Add: xml comment
yn01-dev Nov 24, 2024
4f04079
Remove: MotionBuilder.Preserve()
yn01-dev Nov 24, 2024
cd033a5
Change: SerializableMotionSettings to inherit MotionSettings
yn01-dev Nov 24, 2024
a6acf92
Add: SerializableMotionSettingsDrawer
yn01-dev Nov 24, 2024
c65d936
Fix: drawer
yn01-dev Nov 24, 2024
8218cc3
Merge pull request #149 from AnnulusGames/motion-settings
yn01-dev Nov 24, 2024
4289a6f
Remove: managed function pointer support
yn01-dev Nov 24, 2024
25041a8
Merge pull request #150 from AnnulusGames/remove-managed-pointer-support
yn01-dev Nov 24, 2024
a344577
Rename: LinkBehaviour -> LinkBehavior
yn01-dev Nov 24, 2024
efdb794
Merge pull request #151 from AnnulusGames/rename-link-behavior
yn01-dev Nov 24, 2024
01fdc96
Add: MotionHandle.Duration
yn01-dev Nov 24, 2024
1f248b6
Merge pull request #152 from AnnulusGames/add-duration-property
yn01-dev Nov 26, 2024
f535677
Refactoring
yn01-dev Nov 26, 2024
9f2a60a
Add: MotionDisposeBehavior
yn01-dev Nov 26, 2024
c802e67
Merge pull request #153 from AnnulusGames/handle-dispose
yn01-dev Nov 26, 2024
6d9cb94
Change: ToYieldInteraction -> ToYieldInstruction
yn01-dev Nov 26, 2024
21f400b
Merge pull request #154 from AnnulusGames/rename-toyieldinstruction
yn01-dev Nov 26, 2024
376bf69
Add: format parameter to BindToUnityLogger()
yn01-dev Nov 28, 2024
2f9483e
Merge pull request #155 from AnnulusGames/add-bindtounitylogger-format
yn01-dev Nov 28, 2024
53353ac
Fix: misaligned pointer
yn01-dev Nov 28, 2024
c013906
Change: call OnComplete even if completed by the Time property
yn01-dev Nov 28, 2024
881fa53
Change: allow negative time
yn01-dev Nov 28, 2024
519bc98
Refactoring
yn01-dev Nov 28, 2024
43d44f1
Add: MotionHelper.GetTotalDuration
yn01-dev Nov 28, 2024
8184945
Merge pull request #156 from AnnulusGames/fix-motion-time
yn01-dev Nov 28, 2024
bcf9c46
Fix: burst error
yn01-dev Nov 28, 2024
fb63b3d
Merge pull request #157 from AnnulusGames/fix-burst-error
yn01-dev Nov 29, 2024
0d8a5fc
Add: prototype implementation
yn01-dev Dec 1, 2024
bf58583
Improve: pooling MotionSequenceSource
yn01-dev Dec 1, 2024
487a56d
Improve: pooling MotionSequenceBuilderSource
yn01-dev Dec 1, 2024
ac518c7
Fix: sequence time
yn01-dev Dec 1, 2024
6a10ecb
Change: add sort
yn01-dev Dec 1, 2024
881a5f4
Add: error message
yn01-dev Dec 1, 2024
bd95336
Add: handle status check
yn01-dev Dec 2, 2024
197b5df
Add: invalidating handles added to a sequence
yn01-dev Dec 3, 2024
140efd5
Add: `AppendInterval()` and `Join()`
yn01-dev Dec 4, 2024
83077df
Fix: error occurs when sequences are nested
yn01-dev Dec 4, 2024
9232535
Fix: sequence duration
yn01-dev Dec 4, 2024
4e711a0
Change: `Run()` -> `Schedule()`
yn01-dev Dec 4, 2024
86a2960
Fix: reset time
yn01-dev Dec 4, 2024
8c95592
Fix: Bind is not handled properly when time is rewound
yn01-dev Dec 4, 2024
ba7d44b
Optimize: avoid copy buffer
yn01-dev Dec 4, 2024
d58e4a3
Add: tests
yn01-dev Dec 4, 2024
01eb2d3
Refactoring
yn01-dev Dec 4, 2024
e55f0f8
Change: separate asmdef
yn01-dev Dec 4, 2024
0c9e6aa
Merge pull request #158 from AnnulusGames/feat-sequence
yn01-dev Dec 5, 2024
b043227
Fix: duplicate callbacks are registered for PlayerLoop
yn01-dev Dec 5, 2024
0cb404a
Merge pull request #159 from AnnulusGames/fix-player-loop-initialization
yn01-dev Dec 5, 2024
0095c20
Fix: sandbox
yn01-dev Dec 5, 2024
0fcc6cb
Add: return value of `MotionHandle.Preserve()` for method chaining
yn01-dev Dec 6, 2024
7e1609e
Merge pull request #160 from AnnulusGames/preserve-method-chaining
yn01-dev Dec 6, 2024
24265e6
Improve: MotionSettings and SerializableMotionSettings
yn01-dev Dec 6, 2024
ece1226
Add: test
yn01-dev Dec 6, 2024
4249067
Merge pull request #161 from AnnulusGames/improve-motion-settings
yn01-dev Dec 6, 2024
eba4862
Change: rename BindToCanvasGroupAlpha -> BindToAlpha
yn01-dev Dec 6, 2024
d07dbdd
Add: camera extensions
yn01-dev Dec 6, 2024
dec8558
Add: Rigidbody extensions
yn01-dev Dec 6, 2024
6858254
Add: Rigidbody2D extensions
yn01-dev Dec 6, 2024
c84f451
Update: Built-in -> URP
yn01-dev Dec 6, 2024
3ff5296
Add: Volume extensions
yn01-dev Dec 6, 2024
3237359
Merge pull request #162 from AnnulusGames/improve-bind-extensions
yn01-dev Dec 6, 2024
ecf0f1a
Fix: Complete and Cancel for Sequences do not work properly
yn01-dev Dec 7, 2024
8490b67
Add: tests
yn01-dev Dec 7, 2024
3d02bde
Merge pull request #163 from AnnulusGames/fix-sequence-complete-cancel
yn01-dev Dec 7, 2024
75ea138
Change: calculate random numbers using a hash value derived from the …
yn01-dev Dec 7, 2024
d5c8f46
Fix: context time not passed
yn01-dev Dec 7, 2024
11a972f
Merge pull request #164 from AnnulusGames/fix-random
yn01-dev Dec 7, 2024
cbd6ed0
Fix: BoxMinus1
yn01-dev Dec 7, 2024
a34733c
Fix: TextMeshPro character motion Complete doesn't work
yn01-dev Dec 7, 2024
e48c256
Merge pull request #165 from AnnulusGames/fix-tmp-complete
yn01-dev Dec 7, 2024
6a8368f
Add: WithOnLoopComplete
yn01-dev Dec 7, 2024
97f8fe1
Add: test
yn01-dev Dec 7, 2024
1032f66
Add: MotionHandle.ComplatedLoops
yn01-dev Dec 7, 2024
9d54c77
Merge pull request #166 from AnnulusGames/feat-onloopcomplete
yn01-dev Dec 7, 2024
3d6f1c1
Remove: ManualMotionDispatcher
yn01-dev Dec 7, 2024
00b259b
Remove: IMotionScheduler.Time
yn01-dev Dec 7, 2024
ad02046
Merge pull request #167 from AnnulusGames/remove-scheduler-time
yn01-dev Dec 7, 2024
1986668
Change: rename MotionTracker -> MotionDebugger
yn01-dev Dec 7, 2024
e7a3891
Remove: Scheduler menu
yn01-dev Dec 7, 2024
5b7e2e6
Change: override MotionHandle.ToString()
yn01-dev Dec 8, 2024
f8a337f
Add: DebugName
yn01-dev Dec 8, 2024
4f199ec
Refactoring
yn01-dev Dec 8, 2024
692331d
Improve: debugger
yn01-dev Dec 8, 2024
901ae70
Improve: redesign the layout of LitMotionDebugger window
yn01-dev Dec 8, 2024
e7e9876
Change: EnableTracking -> Enabled
yn01-dev Dec 8, 2024
150f2dc
Add: search field
yn01-dev Dec 8, 2024
432ed8b
Merge pull request #168 from AnnulusGames/feat-debugger
yn01-dev Dec 8, 2024
4b9ed87
Change: rename SkipUpdate->IsInSequence
yn01-dev Dec 8, 2024
71e6458
Add: MotionStoragePermission
yn01-dev Dec 8, 2024
33aa375
Update: tests
yn01-dev Dec 8, 2024
4247763
Remove: ref keyword
yn01-dev Dec 8, 2024
b483028
Merge pull request #169 from AnnulusGames/fix-sequence-item
yn01-dev Dec 8, 2024
94f0988
Fix: OnLoopComplete is called for the wrong motion
yn01-dev Dec 8, 2024
7df5114
Merge pull request #170 from AnnulusGames/fix-onloopcomplete-not-called
yn01-dev Dec 8, 2024
0ad093f
Add: MotionSequenceBuilder.Schedule(configuration)
yn01-dev Dec 8, 2024
5baa01f
Merge pull request #171 from AnnulusGames/sequence-schedule-configura…
yn01-dev Dec 8, 2024
c069de9
Add: package folder
yn01-dev Dec 8, 2024
9c1948f
Add: component view
yn01-dev Dec 9, 2024
c6de449
Add: property drawer
yn01-dev Dec 10, 2024
8fb3b97
Add: editor (in-progress)
yn01-dev Dec 10, 2024
dced04d
Update
yn01-dev Dec 10, 2024
15ac4f5
Update: add component menu
yn01-dev Dec 11, 2024
1952e37
Update: progressbar
yn01-dev Dec 12, 2024
c328394
Add: preview
yn01-dev Dec 12, 2024
eabd6d6
Fix: add button enabled
yn01-dev Dec 12, 2024
8cedcc6
Add: LitMotionAnimation api
yn01-dev Dec 12, 2024
be646f9
Add: PropertyAnimationComponent
yn01-dev Dec 12, 2024
2686811
Fix: enabled not working
yn01-dev Dec 12, 2024
b296e28
Fix: error when itemBuffer is null
yn01-dev Dec 12, 2024
8472ec6
Fix: dropdown
yn01-dev Dec 12, 2024
355a362
Change: remove sequence
yn01-dev Dec 12, 2024
8aa4a73
Add: relative option
yn01-dev Dec 12, 2024
1855a49
Update: displayName default value
yn01-dev Dec 12, 2024
3f70ac0
Add: renderer components
yn01-dev Dec 12, 2024
3f37c8f
Add: value components
yn01-dev Dec 13, 2024
8313cc5
Add: punch/shake components for Transfrom
yn01-dev Dec 13, 2024
be2fa9c
Improve: sort add component menu by menuName
yn01-dev Dec 13, 2024
e9e02ba
Change: PropertyAnimationComponent
yn01-dev Dec 13, 2024
f0a2458
Add: restart button
yn01-dev Dec 13, 2024
1fc4b7b
Fix: SerializableMotionSettingsDrawer
yn01-dev Dec 13, 2024
c40f590
Add: StringOptionsDrawer
yn01-dev Dec 13, 2024
0196f06
Add: StringValue
yn01-dev Dec 13, 2024
b8820d1
Fix: FixedString property field
yn01-dev Dec 14, 2024
6fec8ee
Add: uGUI components
yn01-dev Dec 14, 2024
1b6bd32
Change: rename components
yn01-dev Dec 14, 2024
feb8a97
Fix: default menu name
yn01-dev Dec 14, 2024
2fd2a80
Add: error helpbox when serialize reference type is missing
yn01-dev Dec 14, 2024
318ace4
Add: reset component command
yn01-dev Dec 14, 2024
8e992b1
Change: error message
yn01-dev Dec 14, 2024
d3ccda7
Fix: add null check
yn01-dev Dec 14, 2024
a12745d
Update: error view toggle
yn01-dev Dec 14, 2024
65d0ab7
Add: Volume weight
yn01-dev Dec 14, 2024
b821426
Add: audio animation components
yn01-dev Dec 14, 2024
03f4cb5
Change: rename attribute
yn01-dev Dec 14, 2024
4c33510
Add: RectTransform components
yn01-dev Dec 15, 2024
6316b11
Refactoring
yn01-dev Dec 15, 2024
5352bcb
Update: adjust box label
yn01-dev Dec 15, 2024
a156b7a
Add: MotionHandle.IsPlaying()
yn01-dev Dec 15, 2024
9ad52de
Add: AnimationMode
yn01-dev Dec 15, 2024
dbd3fa2
Fix: ProgressBar style
yn01-dev Dec 15, 2024
c717e32
Add: MoveUp/MoveDown command
yn01-dev Dec 15, 2024
4119a77
Fix: compilation error
yn01-dev Dec 15, 2024
a8c4c0e
Change: sequential animation continution
yn01-dev Dec 15, 2024
49bbe86
Add: control components
yn01-dev Dec 15, 2024
0703d0e
Change: revert process
yn01-dev Dec 15, 2024
5b227b3
Add: onRevert
yn01-dev Dec 15, 2024
41639c1
Add: TextMeshPro components
yn01-dev Dec 15, 2024
c0baf85
Fix: TMP_Text icon
yn01-dev Dec 15, 2024
8e39c8b
Change: add component menu name
yn01-dev Dec 15, 2024
92ca572
Add: camera components
yn01-dev Dec 15, 2024
2cab538
Improve: add icon to dropdown item
yn01-dev Dec 15, 2024
73f872f
Add: Rigidbody / Rigidbody2D components
yn01-dev Dec 15, 2024
3700007
Change: rename transform components
yn01-dev Dec 15, 2024
0003722
Change: default playOnAwake value to true
yn01-dev Dec 15, 2024
b955680
Fix: index out of range error
yn01-dev Dec 15, 2024
e2e0bd1
Add: error handling
yn01-dev Dec 15, 2024
b95b9b2
Add: icon
yn01-dev Dec 15, 2024
6ca4ae1
Remove: unnecessary reference
yn01-dev Dec 15, 2024
96e5c2c
Add: keyword
yn01-dev Dec 15, 2024
b55c01b
Merge pull request #172 from AnnulusGames/feat-visual-editor
yn01-dev Dec 15, 2024
a6af89f
Refactoring
yn01-dev Dec 20, 2024
2d0b574
Change: rename MotionConfiguredSource -> MorionTaskSource
yn01-dev Dec 20, 2024
5db8ecf
Change: MotionData to internal
yn01-dev Dec 20, 2024
4fedd41
Fix: typo
yn01-dev Dec 20, 2024
834ab14
Refactoring: complete
yn01-dev Dec 20, 2024
7551cea
Rename
yn01-dev Dec 20, 2024
357c65b
Merge pull request #175 from AnnulusGames/refactoring
yn01-dev Dec 20, 2024
9e924d8
Remove: toggleOnLabelClick
yn01-dev Dec 20, 2024
62bf062
Merge pull request #176 from AnnulusGames/fix-toggleonlabelclick
yn01-dev Dec 20, 2024
04d043f
Add: ManualMotionDispatcher
yn01-dev Dec 20, 2024
c51c81a
Update: MotionScheduler.Manual
yn01-dev Dec 20, 2024
5d32740
Change: DispatcherScheduler -> ManualMotionDispatcherScheduler
yn01-dev Dec 20, 2024
af62597
Fix: GetOrCreateRunner
yn01-dev Dec 20, 2024
3109283
Fix: UpdateRunner
yn01-dev Dec 20, 2024
e3c28de
Fix: manual Update not working
yn01-dev Dec 20, 2024
45b64a3
Add: tests
yn01-dev Dec 20, 2024
16db144
Merge pull request #177 from AnnulusGames/add-manualmotiondispatcher
yn01-dev Dec 20, 2024
9914f4a
Add: `MotionHandle.None`
yn01-dev Dec 20, 2024
5dfe91c
Merge pull request #178 from AnnulusGames/add-motionhandle-none
yn01-dev Dec 20, 2024
b8bdd9e
Change: BindOnSchedule -> ImmidiateBind
yn01-dev Dec 20, 2024
0510c6d
Merge pull request #179 from AnnulusGames/immediate-bind
yn01-dev Dec 20, 2024
5000b69
Revert: MotionCancelBehavior -> CancelBehavior
yn01-dev Dec 20, 2024
5e52e05
Update: package.json package version
yn01-dev Dec 20, 2024
60cc3ee
Fix: LitMotion Animation inspectot
yn01-dev Dec 20, 2024
258a348
Merge pull request #180 from AnnulusGames/fix-animation-inspector
yn01-dev Dec 20, 2024
5fea753
Update: tests
yn01-dev Dec 20, 2024
4ff7568
Update: LitMotionAnimation API
yn01-dev Dec 20, 2024
9a33825
Change: rename Revert -> Stop
yn01-dev Dec 20, 2024
d856c35
Fix: error when animation contains MotionHandle.None
yn01-dev Dec 20, 2024
d97a09c
Add: PlayLitMotionAnimationComponent
yn01-dev Dec 20, 2024
1a037dc
Merge pull request #181 from AnnulusGames/change-animation-api
yn01-dev Dec 20, 2024
9272eb3
Fix: LitMotionEditor inspector buttons
yn01-dev Dec 20, 2024
55f8110
Merge branch 'v2.0' of https://github.com/AnnulusGames/LitMotion into…
yn01-dev Dec 20, 2024
e904d55
Fix: no copy is done when allocating the buffer in sequence builder
yn01-dev Dec 21, 2024
ed6688b
Merge pull request #182 from AnnulusGames/fix-sequence-builder
yn01-dev Dec 21, 2024
8d52099
Fix: LitMotionAnimation
yn01-dev Dec 21, 2024
2f0a8a6
Change: rename animation component events
yn01-dev Dec 21, 2024
26b13f4
Merge pull request #183 from AnnulusGames/rename-animation-component-…
yn01-dev Dec 21, 2024
dacdda4
Fix: MotionSequenceSource
yn01-dev Dec 21, 2024
b7653c8
Change: move LitMotion.Sequneces -> LitMotion
yn01-dev Dec 21, 2024
67e0b9f
Update: sandbox
yn01-dev Dec 21, 2024
aae37fc
Add: handle.Duration and handle.Loops
yn01-dev Dec 21, 2024
1748b41
Add: handle.Delay
yn01-dev Dec 21, 2024
4037145
Merge pull request #184 from AnnulusGames/add-duration-and-loops
yn01-dev Dec 21, 2024
498ef08
Update: ja docs
yn01-dev Dec 24, 2024
d527992
Update: en docs
yn01-dev Dec 24, 2024
f9939e4
Merge pull request #185 from AnnulusGames/update-docs
yn01-dev Dec 25, 2024
4c0e4d6
Change: sequence.Schedule() -> Run()
yn01-dev Dec 25, 2024
9b14018
Change: MotionDisposeBehavior -> DisposeBehavior
yn01-dev Dec 25, 2024
4d89100
Merge pull request #186 from AnnulusGames/api-adjustments
yn01-dev Dec 25, 2024
d59a2bc
Update: docs
yn01-dev Dec 25, 2024
6dffe99
Update: README
yn01-dev Dec 25, 2024
38095ee
Update: header image
yn01-dev Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
95 changes: 73 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,31 @@ LitMotion is a high-performance tween library for Unity. LitMotion includes a ri

LitMotion is my second tween library I created after [Magic Tween](https://github.com/AnnulusGames/MagicTween). LitMotion was designed based on experience implementing Magic Tween to achieve rich functionality and extremely high performance. In all situations such as creating and updating tweens, it exhibits overwhelming performance that is 2 to 20 times faster than other tween libraries. Of course, there is no allocation at all when creating a tween.

![img](./docs/images/img-v2-available.png)

Additionally, v2 introduces Sequence for combining multiple motions and the LitMotion.Animation package, which allows you to create tween animations directly from the Inspector. With these additions, LitMotion is now as powerful, if not more, than DOTween Pro or PrimeTween in terms of features.

## Documentation

The full version of documentation can be found [here](https://annulusgames.github.io/LitMotion/).

## Features

- Animate anything in one line of code.
- Achieves zero allocations due to its struct-based design.
- Highly optimized using DOTS (Data-Oriented Technology Stack).
- Works in both runtime and editor.
- Provides a rich set of schedulers, allowing you to specify the PlayerLoop to execute.
- Apply complex settings like easing and looping.
- Wait for completion via callbacks/coroutines.
- Zero allocation string animation with FixedString and TextMeshPro
- Character animation for TextMeshPro text.
- Motion Tracker Window for monitoring motions in progress.
- Convert to Observables using UniRx.
- Convert to Observables using R3.
- Supports async/await via UniTask.
- Extend types using `IMotionOptions` and `IMotionAdapter`.
* Animate anything in one line of code.
* Achieves zero allocations with the struct-based design
* Extremely high-performance implementation optimized using DOTS (Data-Oriented Technology Stack)
* Works in both runtime and editor
* Supports complex settings like easing and looping
* Waits for completion using callbacks/coroutines
* Zero allocation text animationSupports TextMesh Pro / UI Toolkit
* Special motions like Punch, Shake, etc.
* Conversion to Observable using [UniRx](https://github.com/neuecc/UniRx) / [R3](https://github.com/Cysharp/R3)
* async/await support using [UniTask](https://github.com/Cysharp/UniTask)
* Type extension with `IMotionOptions` and `IMotionAdapter`
* Integration with the Inspector via `SerializableMotionSettings<T, TOptions>`
* Debugging API and LitMotion Debugger window
* Combine animations using `LSequence`
* Create complex animations directly from the Inspector with the [LitMotion.Animation](articles/en/litmotion-animation-overview.md) package

## Setup

Expand Down Expand Up @@ -74,7 +79,7 @@ Here's a sample code. Refer to the documentation for more details.
using System;
using System.Threading;
using UnityEngine;
using UniRx; // UniRx
using R3; // R3
using Cysharp.Threading.Tasks; // UniTask
using LitMotion;
using LitMotion.Extensions;
Expand Down Expand Up @@ -157,12 +162,12 @@ public class Example : MonoBehaviour
await handle.ToUniTask(cancellationToken); // Await with passing CancellationToken
}

// Convert to IObservable<T> using UniRx
// Convert to Observable<T> using R3
void RxExample()
{
LMotion.Create(0f, 1f, 2f)
.ToObservable() // Create motion as IObservable<T>
.Where(x => x > 0.5f) // Utilize UniRx operators
.ToObservable() // Create motion as Observable<T>
.Where(x => x > 0.5f) // Utilize R3 operators
.Select(x => x.ToString())
.Subscribe(x =>
{
Expand All @@ -173,13 +178,59 @@ public class Example : MonoBehaviour
}
```

## Motion Tracker
## Sequence

The Sequence feature is provided for combining multiple motions.

```cs
LSequence.Create()
.Append(LMotion.Create(0f, 1f, 1f).BindToPositionX(transform))
.Join(LMotion.Create(0f, 1f, 1f).BindToPositionY(transform))
.Insert(0f, LMotion.Create(0f, 1f, 1f).BindToPositionZ(transform))
.Run();
```

For more details, refer to the [Sequence](https://annulusgames.github.io/LitMotion/ja/sequence.html) section in the documentation.

## LitMotion.Animation

LitMotion.Animation is an additional package that provides animation functionality built with LitMotion.

By introducing this package, you can use the LitMotion Animation component to construct animations in the Inspector.

![img](./docs/images/img-litmotion-animation.gif)


### Requirements

* Unity 2021.3 or later
* LitMotion 2.0.0 or later

### Installation

You can install LitMotion using the Package Manager.

1. Open Package Manager by navigating to Window > Package Manager.
2. Click on the "+" button and select "Add package from git URL."
3. Enter the following URL:

```text
https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion.Animation
```

Alternatively, you can open the `Packages/manifest.json` file and add the following line within the `dependencies` block:

You can track all active motions using the Motion Tracker Window.
```json
{
"dependencies": {
"com.annulusgames.lit-motion.animation": "https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion.Animation"
}
}
```

<img src="https://annulusgames.github.io/LitMotion/images/motion-tracker-window.png" width="800">
### How to Use

For more details, please refer to [Motion Tracker](https://annulusgames.github.io/LitMotion/articles/en/motion-tracker.html).
For how to use LitMotion.Animation, please refer to the documentation on [LitMotion.Animation](https://annulusgames.github.io/LitMotion/ja/litmotion-animation-overview.html).

## Performance

Expand Down
91 changes: 69 additions & 22 deletions README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@ LitMotionはUnity向けのハイパフォーマンスなトゥイーンライブ

LitMotionは[Magic Tween](https://github.com/AnnulusGames/MagicTween)に続いて私が作成した2つ目のトゥイーンライブラリです。LitMotionはMagic Tweenの実装で得た経験をもとに、必要十分な機能を厳選しつつ、最速で動作させることを念頭に置いて設計されました。トゥイーンの作成や駆動などあらゆるシチュエーションにおいて、他のトゥイーンライブラリと比較して2倍から20倍以上の圧倒的なパフォーマンスを発揮します。当然、トゥイーン作成時のアロケーションも一切ありません。

![img](./docs/images/img-v2-available.png)

また、v2より複数のモーションを合成するためのSequenceと、Inspectorからトゥイーンアニメーションを作成可能なLitMotion.Animationパッケージが追加されました。これにより機能面においてもDOTween ProやPrimeTweenと同等または以上に強力なライブラリとなっています。

## ドキュメント

ドキュメントのフルバージョンは[こちら](https://annulusgames.github.io/LitMotion/)から確認できます。

## 特徴

- あらゆる値をコード一行でアニメーション可能
- 構造体ベースの設計でゼロアロケーションを達成
- DOTSを活用して最適化された極めてハイパフォーマンスな実装
- ランタイムとエディタの両方で動作
- 実行するPlayerLoopを指定する豊富なSchedulerを用意
- イージングや繰り返しなど複雑な設定を適用可能
- コールバック/コルーチンによる完了の待機
- FixedStringとTextMeshProによるゼロアロケーションな文字列のアニメーション
- TextMeshProのテキストを文字ごとにアニメーション可能
- MotionTrackerウィンドウによる動作中のモーションの追跡
- UniRxを利用したObservableへの変換
- R3を利用したObservableへの変換
- UniTaskを利用したasync/await対応
- `IMotionOptions`と`IMotionAdapter`を用いた型の拡張
* あらゆる値をコード一行でアニメーション可能
* 構造体ベースの設計でゼロアロケーションを達成
* DOTSを活用して最適化された極めてハイパフォーマンスな実装
* ランタイムとエディタの両方で動作
* イージングや繰り返しなど複雑な設定を適用可能
* コールバック/コルーチンによる完了の待機
* ゼロアロケーションなテキストアニメーション
* TextMesh Pro / UI Toolkitに対応
* Punch、Shakeなどの特殊なモーション
* UniRx/R3を利用したObservableへの変換
* UniTaskを利用したasync/await対応
* `IMotionOptions`と`IMotionAdapter`を用いた型の拡張
* `SerializableMotionSettings<T, TOptions>`によるInspectorとの統合
* デバッグ用のAPIおよびLitMotion Debuggerウィンドウ
* Sequenceによるアニメーションの合成
* Inspectorから複雑なアニメーションを作成可能なLitMotion.Animationパッケージ

## セットアップ

Expand Down Expand Up @@ -74,7 +80,7 @@ LitMotionを用いることでTransformやMaterialなどの値を簡単にアニ
using System;
using System.Threading;
using UnityEngine;
using UniRx; // UniRx
using R3; // R3
using Cysharp.Threading.Tasks; // UniTask
using LitMotion;
using LitMotion.Extensions;
Expand Down Expand Up @@ -157,12 +163,12 @@ public class Example : MonoBehaviour
await handle.ToUniTask(cancellationToken); // ToUniTaskでCancellationTokenを渡してawait
}

// UniRxを利用したIObservable<T>への変換に対応
// R3を利用したObservable<T>への変換に対応
void RxExample()
{
LMotion.Create(0f, 1f, 2f)
.ToObservable() // モーションをIObservable<T>として作成
.Where(x => x > 0.5f) // UniRxのオペレータを利用可能
.ToObservable() // モーションをObservable<T>として作成
.Where(x => x > 0.5f) // R3のオペレータを利用可能
.Select(x => x.ToString())
.Subscribe(x =>
{
Expand All @@ -173,13 +179,54 @@ public class Example : MonoBehaviour
}
```

## Motion Tracker
## Sequence

複数のモーションを合成するための機能として、Sequenceが提供されています。

```cs
LSequence.Create()
.Append(LMotion.Create(0f, 1f, 1f).BindToPositionX(transform))
.Join(LMotion.Create(0f, 1f, 1f).BindToPositionY(transform))
.Insert(0f, LMotion.Create(0f, 1f, 1f).BindToPositionZ(transform))
.Run();
```

詳細はドキュメントの[Sequence](https://annulusgames.github.io/LitMotion/ja/sequence.html)を参照してください。

## LitMotion.Animation

LitMotion.AnimationはLitMotionで構築されたアニメーションの機能を提供する追加パッケージです。これを導入することで、Inspector上でアニメーションを構築できるLitMotion Animationコンポーネントが利用可能になります。

![img](./docs/images/img-litmotion-animation.gif)

### 要件

* Unity 2021.3 以上
* LitMotion 2.0.0 以上

### インストール

1. Window > Package ManagerからPackage Managerを開く
2. 「+」ボタン > Add package from git URL
3. 以下のURLを入力

```text
https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion.Animation
```

あるいはPackages/manifest.jsonを開き、dependenciesブロックに以下を追記します。

Motion Trackerウィンドウを使用して動作中の全てのモーションを追跡できます。
```json
{
"dependencies": {
"com.annulusgames.lit-motion.animation": "https://github.com/AnnulusGames/LitMotion.git?path=src/LitMotion/Assets/LitMotion.Animation"
}
}
```

<img src="https://annulusgames.github.io/LitMotion/images/motion-tracker-window.png" width="800">
### 使い方

詳細は[Motion Tracker](https://annulusgames.github.io/LitMotion/articles/ja/motion-tracker.html)を参照してください。
LitMotion.Animationの使い方はドキュメントの[LitMotion.Animation](https://annulusgames.github.io/LitMotion/ja/litmotion-animation-overview.html)を参照してください。

## パフォーマンス

Expand Down
59 changes: 0 additions & 59 deletions docs/articles/en/about.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Avoiding Dynamic Memory Allocation
## Avoid Dynamic Memory Allocation

You can expand the capacity of the internal array that holds motions beforehand by calling `MotionDispatcher.EnsureStorageCapacity()`. By ensuring the maximum anticipated capacity, such as during the app's startup, you can mitigate runtime dynamic memory allocation.

Expand Down
49 changes: 49 additions & 0 deletions docs/articles/en/await-motion-in-async-await.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Await Motion in async/await

`MotionHandle` implements the `GetAwaiter()` method, allowing you to directly await it to wait for completion.

```cs
await handle;
```

If you want to pass a `CancellationToken`, you can use `ToValueTask()` / `ToAwaitable()` or UniTask.

## ValueTask

You can convert a motion to a `ValueTask` using `MotionHandle.ToValueTask()`. This allows you to use async/await to wait for the completion of the motion.

```cs
async ValueTask ExampleAsync(CancellationToken cancellationToken)
{
await LMotion.Create(0f, 10f, 1f)
.RunWithoutBinding()
.ToValueTask(cancellationToken);
}
```

However, using `ValueTask` in Unity has some performance concerns. For the best performance, it is recommended to use UniTask. For integration with UniTask, refer to the [UniTask](integration-unitask.md) guide.

### Awaitable

Starting from Unity 2023.1, Unity provides the [Awaitable](https://docs.unity3d.com/2023.1/Documentation/ScriptReference/Awaitable.html) class to enable efficient async/await handling within Unity.

If you're using Unity 2023.1 or later, LitMotion provides the `ToAwaitable()` extension method to convert a `MotionHandle` to an `Awaitable`. This allows you to use async/await to wait for motion completion.

```cs
async Awaitable ExampleAsync(CancellationToken cancellationToken)
{
await LMotion.Create(0f, 10f, 1f)
.RunWithoutBinding()
.ToAwaitable(cancellationToken);
}
```

### Changing Behavior on Cancellation

By specifying `CancelBehavior` in the arguments for `ToValueTask()` / `ToAwaitable()`, you can change the behavior when the async method is canceled. Additionally, setting `cancelAwaitOnMotionCanceled` to `true` allows the async method to be canceled when the `MotionHandle` is canceled.

```cs
await LMotion.Create(0f, 10f, 1f)
.RunWithoutBinding()
.ToAwaitable(CancelBehavior.Complete, true, cancellationToken);
```
Loading