Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DOTween便利Tips集/dotween-tips
Search
ゆーじ
March 24, 2021
Programming
3
2.6k
DOTween便利Tips集/dotween-tips
知らなかった!DOTween便利Tips集
ゆーじ
March 24, 2021
Tweet
Share
More Decks by ゆーじ
See All by ゆーじ
モチベーションとモーションの話/motivation-and-motion
yusuke57
0
290
パズル制作と絵作り(ドット絵)の話 / u1w-clones
yusuke57
0
360
DOTweenという神アセットの話 / DOTween-god-asset
yusuke57
0
1.3k
UI/UXを意識して 超快適なゲーム作ってみた / Push
yusuke57
1
580
Other Decks in Programming
See All in Programming
C#および.NETに対する誤解をひも解く
ymd65536
0
220
上手に付き合うコンポーネントテスト
quramy
3
1.2k
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
1.1k
What is TDD?
urakawa_jinsei
1
200
Frontend Magic mit CSS Houdini
joergneumann
0
420
ECS向けのドリフト検知機構を実装してみた
tkikuc
0
270
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
500
Infrastructure as Code でセキュリティを楽にしよう!
konokenj
5
1.4k
5年分のツケを一気に払った話
soogie
3
1.1k
Unlocking Python's Core Magic
leew
0
110
"noncopyable types" の使いどころについて考えてみた
andpad
0
130
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
140
Featured
See All Featured
From Idea to $5000 a Month in 5 Months
shpigford
380
46k
Practical Orchestrator
shlominoach
185
10k
Building a Scalable Design System with Sketch
lauravandoore
459
32k
How to Think Like a Performance Engineer
csswizardry
16
1k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.8k
Large-scale JavaScript Application Architecture
addyosmani
509
110k
Designing for Performance
lara
604
68k
The Cost Of JavaScript in 2023
addyosmani
43
5.8k
A Tale of Four Properties
chriscoyier
155
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
125
18k
Music & Morning Musume
bryan
46
6.1k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Transcript
8 min Gotanda.unity #17 ゆーじ @yuji_ap
自己紹介 『CUBE CLONES』 AppStore / GooglePlay 370円 DOTweenやUIデザインが好きなエンジニア 最近パズルゲームをリリースしました
今日の内容 便利だけど知らない人がいそうなDOTweenの機能をパパッと7つ紹介 DOTween触ったことない方は、 これだけ覚えてもらえれば何となく理解できるかと思います...! [ 対象 ] [ 操作 ]
[ 値 ] [ 秒数 ] 自身を X方向に動かす 3まで 0.5秒間で
秒数に0を指定する 便利Tips ①
秒数に0を指定する position.xの値を変更したい場合 DOMoveX()で秒数に0を指定すれば、同じことが1行でできる
相対的な値を指定する 便利Tips ②
相対的な値を指定する 通常は絶対的な値を指定する SetRelative(true) で相対的な値を指定できる
timescaleを無視する 便利Tips ③
timescaleを無視する SetUpdate(true)をつけることでtimescaleを無視できる ちなみにTween自体のtimescaleは以下のように変えられる
開始時の値を指定する 便利Tips ④
開始時の値を指定する 通常は終了時の値を指定する From() で開始時の値を指定できる 開始時に第一引数の値に瞬時に変わり、元の値まで進む
一定時間後に処理実行する 便利Tips ⑤
一定時間後に処理実行する UniTask、コルーチン、Invokeメソッドなど 広く知られている方法がいくつかある DOTweenを入れていれば、 DOVirtual.DelayCall() でも実現できる
共通のパラメータを使う 便利Tips ⑥
共通のパラメータを使う TweenParams型の変数にメソッドチェインでパラメータを指定することで、 パラメータのプリセットのようなものが作れる SetAs() でTweenに適用できる →同じパラメータを複数Tweenで使い回すことができる
SetAs()の別の使い方 SetAs() は引数に直接Tweenを指定することもできる →パラメータをコピーできる
往復アニメーション 便利Tips ⑦
往復アニメーション Loop回数を2、LoopTypeをYoyoにすることで 往復アニメーションができる 時間の都合上省略するが、 Ease.Flash系でも似たことが実現できる
まとめ DOTweenは便利な使い方がたくさん! 使っていく中で見つける便利ハックみたいなものもあるが、 今回紹介したものも半分以上は公式ドキュメントに書いてある http://dotween.demigiant.com/documentation.php
おまけ DOTweenの逆引きサンプル集をいつか作りたい 完成しているUIアニメーションを提示して、 「これはDOTweenでどう作っているのか」を解説する形式 「動かせます」「色が変わります」は機能として分かるけど、 じゃあいい感じのアニメーションを作るには何を動かして何色に変えればいいの? →完成品を見て「これのこの部分を真似したい!」が効率的なのでは
Gotanda.unity #17 ゆーじ @yuji_ap ① 秒数に0を指定する DOMoveX(3f, 0) ② 相対的な値を指定する SetRelative(true) ③
timescaleを無視する SetUpdate(true) ④ 開始時の値を指定する From() ⑤ 一定時間後に処理実行する DOVirtual.DelayCall() ⑥ 共通のパラメータを使う TweenParams, SetAs() ⑦ 往復アニメーション SetLoops(2, LoopType.Yoyo)