-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7710390
commit 017e156
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Updating Motion Manually | ||
|
||
You can configure the motion's update process to be manual by specifying `MotionScheduler.Manual` as the scheduler. | ||
|
||
```cs | ||
// Specify MotionScheduler.Manual as the scheduler | ||
var handle = LMotion.Create(value, endValue, 2f) | ||
.WithScheduler(MotionScheduler.Manual) | ||
.BindToUnityLogger(); | ||
``` | ||
|
||
For motions with `MotionScheduler.Manual`, you need to manually update the motion using `ManualMotionDispatcher.Update()`. | ||
|
||
```cs | ||
while (handle.IsActive()) | ||
{ | ||
var deltaTime = 0.1f; | ||
// Update using ManualMotionDispatcher.Update() | ||
ManualMotionDispatcher.Update(deltaTime); | ||
} | ||
``` | ||
|
||
Also, when you have disabled Domain Reload, the motion's state might not initialize, leading to unexpected behavior. To avoid this, explicitly initialize it at startup using `ManualMotionDispatcher.Reset()`. | ||
|
||
```cs | ||
void Awake() | ||
{ | ||
ManualMotionDispatcher.Reset(); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# モーションを手動で更新する | ||
|
||
Schedulerに`MotionScheduler.Manual`を指定することで、モーションの更新処理を手動で行うように設定することができます。 | ||
|
||
```cs | ||
// SchedulerにMotionScheduler.Manualを指定 | ||
var handle = LMotion.Create(value, endValue, 2f) | ||
.WithScheduler(MotionScheduler.Manual) | ||
.BindToUnityLogger(); | ||
``` | ||
|
||
`MotionScheduler.Manual`を指定したモーションは`ManualMotionDispatcher.Update()`を用いて手動で更新処理を行う必要があります。 | ||
|
||
```cs | ||
while (handle.IsActive()) | ||
{ | ||
var deltaTime = 0.1f; | ||
// ManualMotionDispatcher.Update()で更新を行う | ||
ManualMotionDispatcher.Update(deltaTime); | ||
} | ||
``` | ||
|
||
またDomain Reloadをオフにしている場合、モーションの状態が初期化されないため予期しない動作を起こすことがあります。これを避けるためには、起動時に`ManualMotionDispatcher.Reset()`で明示的に初期化を行う必要があります。 | ||
|
||
```cs | ||
void Awake() | ||
{ | ||
ManualMotionDispatcher.Reset(); | ||
} | ||
``` |