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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
ゆーじ
March 24, 2021
Programming
3.3k
3
Share
DOTween便利Tips集/dotween-tips
知らなかった!DOTween便利Tips集
ゆーじ
March 24, 2021
More Decks by ゆーじ
See All by ゆーじ
モチベーションとモーションの話/motivation-and-motion
yusuke57
0
370
パズル制作と絵作り(ドット絵)の話 / u1w-clones
yusuke57
0
420
DOTweenという神アセットの話 / DOTween-god-asset
yusuke57
0
1.5k
UI/UXを意識して 超快適なゲーム作ってみた / Push
yusuke57
1
650
Other Decks in Programming
See All in Programming
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
280
20260514_its_the_context_window_stupid.pdf
heita
0
1k
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
710
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3.1k
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
150
Making the RBS Parser Faster
soutaro
0
720
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
260
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
220
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
It's Worth the Effort
3n
188
29k
New Earth Scene 8
popppiees
3
2.2k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
640
Faster Mobile Websites
deanohume
310
31k
Being A Developer After 40
akosma
91
590k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
180
Prompt Engineering for Job Search
mfonobong
0
300
Raft: Consensus for Rubyists
vanstee
141
7.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Adaptive Systems
keathley
44
3k
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)