Open
Conversation
Open
tsugehara
commented
Jan 18, 2025
| } | ||
|
|
||
| var flag_complete = false; | ||
| var target_layers = pm.layer == "layer_camera" ? $(".layer_camera:visible") : $("." + pm.layer + "_fore:visible"); |
Contributor
Author
There was a problem hiding this comment.
解決5: 「制御対象のレイヤーをアニメーションが発動するレイヤーのみに限定する」です。
:visible でないレイヤーはアニメーション動かないので、動くレイヤーのみに限定しました。
tsugehara
commented
Jan 18, 2025
| "transform": `scale(${to_camera.scale}) translate(${to_camera.x}, ${to_camera.y}) rotate(${to_camera.rotate})` | ||
| }); | ||
| this.kag.stat.current_camera[pm.layer] = to_camera; | ||
| that.kag.ftag.nextOrder(); |
Contributor
Author
There was a problem hiding this comment.
解決4: 「time = 0で利用した場合に処理を即終了するようにする」です。
transformの値をmatrixで計算するのが少し面倒だったので、translate, scale, rotateに分けて入れてます。
tsugehara
commented
Jan 18, 2025
| if (that.kag.stat.is_wait_camera == true) { | ||
| that.kag.stat.is_wait_camera = false; | ||
| that.kag.ftag.nextOrder(); | ||
| if (++complete_count === target_layers.length) { |
Contributor
Author
There was a problem hiding this comment.
解決4: 「cameraをwait=trueで利用した場合、300ms待つのをやめる」です。
最初のcompleteイベントから一定時間、ではなく、最後のcompleteイベントを待つようにしました。
tsugehara
commented
Jan 18, 2025
| //duration を確認する | ||
|
|
||
| if (parseInt(pm.time) < 10) { | ||
| var target_layers = pm.layer == "layer_camera" ? $(".layer_camera:visible") : $("." + pm.layer + "_fore:visible"); |
Contributor
Author
There was a problem hiding this comment.
解決3: 「reset_cameraでも、camera同様の対応を入れる」です。
ここから下すべて、ちょっとコピペが多いですが、reset_cameraにcameraと同じ対応を入れるための処理です。
tsugehara
commented
Jan 18, 2025
| //カメラを待ってる状態なら | ||
| if (that.kag.stat.is_wait_camera == true) { | ||
| that.kag.stat.is_wait_camera = false; | ||
| that.kag.ftag.nextOrder(); |
Contributor
Author
There was a problem hiding this comment.
解決2: 「wait=falseで利用した場合に、wait_cameraが正しく動作するようにする」です。
is_wait_cameraの処理をwait = trueの場合と揃えています
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
以下の説明並びにコードに対するコメントをご参照ください。
前提
#132 同様、cameraをwait=falseで利用した場合、連続で利用するとwait_cameraをかけても上手く動作しないことがある。
また、cameraをwait=trueで利用すると、動きが少しもっさりする。
132では対応していなかったが、アニメーションを設定するレイヤーが必要以上に多い、並びに time = 0でカメラをかけても10ms + 20ms待たされるという問題がある。
解決する問題
副作用
これまで a3dの「最初のcompleteイベント」で判断していたのを、「最後のcopmleteイベント」で判断する形に変更したため、completeイベントが飛んでこないケースでは固まることがありえる。
解決しない問題
(132同様)
cameraをwait="false"で起動し、その演出が終わらない内に違うcameraを起動する。
この場合、前のcameraのcompleteイベントで次のcameraが終了扱いされてしまう問題が残る。
このため、cameraの利用はwait=trueで利用するか、wait=falseで利用した後次のcamera演出の前に必ずwait_cameraを挟む、という制約をつける必要がある。本制約は本PRで解決せず、また文書にもない。
※本PR前の状態だとそもそもwait_cameraで待ちきれないので、この制約を守っても複数回のcamera演出の連続仕様をwait=falseで利用する事は難しい状態だったのが、本制約をつければ利用する事ができるようになった、ともいえる