ロングタップのみを実装するように変更#1
Open
dwl398 wants to merge 4 commits intopaldynojosh:masterfrom
Open
Conversation
dwl398
commented
Feb 22, 2022
| [RequireComponent(typeof(Graphic))] | ||
| public class LongTapEventHandler : MonoBehaviour | ||
| { | ||
| [SerializeField] private Graphic _raycastImage; |
Author
There was a problem hiding this comment.
[RequireComponent(typeof(Graphic))]があるので無駄なシリアライズを削除しました
dwl398
commented
Feb 22, 2022
Comment on lines
+44
to
+45
| var time = Time.time; | ||
| await _raycastImage.OnPointerUpAsObservable().Take(1).ToUniTask(cancellationToken: cancellationToken); |
Author
There was a problem hiding this comment.
1回だけポインターアップのイベントが発行されるのを待つ
他にもポインターが領域外に行くとか色々ダメになる条件はあるけど
それ系の追加はサボりました
dwl398
commented
Feb 22, 2022
| await _raycastImage.OnPointerUpAsObservable().Take(1).ToUniTask(cancellationToken: cancellationToken); | ||
|
|
||
| try | ||
| if (_delayStartLongTap + _fireLongTapTime < Time.time - time) |
Author
There was a problem hiding this comment.
公開するイベントがロングタップだけなら _fireLongTapTimeだけでヨサソウ
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.
サンプルの実装を見てなくて押下後の経過時間などに一ミリも対応できてないので全然使えないです
ロングタップの部分だけもっと簡潔に書けそうだなーと思ってPR作成したので参考になれば!