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
さぁTilemapを始めよう!
Search
RyotaMurohoshi
January 31, 2018
Technology
1
1k
さぁTilemapを始めよう!
2018/01/31に開催された#Gotauni No.4の@RyotaMurhoshiの発表資料です
RyotaMurohoshi
January 31, 2018
Tweet
Share
More Decks by RyotaMurohoshi
See All by RyotaMurohoshi
Unityの合同同人誌や合同商業誌を書いてる僕は感想やレビューや評価が欲しい
ryotamurohoshi
0
340
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
620
Odin Validationはいいぞ!
ryotamurohoshi
2
840
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.3k
Unityでも、新しいC#
ryotamurohoshi
0
1.2k
Riderはいいぞ!
ryotamurohoshi
1
3.2k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.2k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
36k
ImportedLinqのススメ
ryotamurohoshi
0
1.3k
Other Decks in Technology
See All in Technology
わたしとトラックポイント / TrackPoint tips
masahirokawahara
1
240
Commitment vs Harrisonism - Keynote for Scrum Niseko 2024
miholovesq
6
1.1k
ガチ勢によるPipeCD運用大全〜滑らかなCI/CDを添えて〜 / ai-pipecd-encyclopedia
cyberagentdevelopers
PRO
3
210
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
1
620
Shift-from-React-to-Vue
calm1205
3
1.3k
カメラを用いた店内計測におけるオプトインの仕組みの実現 / ai-optin-camera
cyberagentdevelopers
PRO
1
120
ネット広告に未来はあるか?「3rd Party Cookie廃止とPrivacy Sandboxの効果検証の裏側」 / third-party-cookie-privacy
cyberagentdevelopers
PRO
1
130
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
480
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
470
Autify Company Deck
autifyhq
1
39k
なんで、私がAWS Heroに!? 〜社外の広い世界に一歩踏み出そう〜
minorun365
PRO
6
1.1k
Fargateを使った研修の話
takesection
0
120
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
We Have a Design System, Now What?
morganepeng
50
7.2k
Building Your Own Lightsaber
phodgson
102
6.1k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
RailsConf 2023
tenderlove
29
880
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Transcript
̵ͫ͗TilemapΨতΗΞ͜Ѻ by @RyotaMurohoshi 2018/01/31() Gotanda.unity #4
Asset StoreͩΩίψϐϕ͘͢ΠΔͯ
None
None
None
None
όαϸ΄ኮ؟ίψϐϕѺ
෯ᇇ΄Asset Store΅ ϓμφώϰѿϫϓϷίϸ > 2DόαϸϫϐϤ ͼθϓρϷΘ͘ΠΔͭ͵Ѻ h"ps:/ /www.assetstore.unity3d.com/jp/?stay#!/search/page=1/sortby=popularity/query=category:140
Ꭵ୵ኮ؟(όαϸ)Ψͣ払Η͵ϫϐϤ όαϸϫϐϤ ͚ΣΩοЄϭͽֵΥͼ͚Δͯ
Ϥ϶ϐϕϢζЄϭοЄϭ
䜐ኼτϬϲϹЄτϴЀοЄϭ
ϺЄν϶αμοЄϭ
ͳͭͼ ϺЄϸϤϹαЀνοЄϭ
զڹ΄Unityͽ΅ͩ΄Ξ͜οЄϭݻͧ όαϸϫϐϤΨ֢Ρ΄΅ಋ樌͢͡͡ΠΔͭ͵
• ֜㮆Θ֜㮆ΘSpriteRendererΨᯈᗝͯΡ • όαϸϫϐϤ΄AssetΨAsset Storeͽ揮ͼ̵ֵ͚ොΨ憝͞Ρ • όαϸϫϐϤτφϓϭΨᛔ֢ͭͼϮЀϓϗЀφͯΡ
Unity 2017.2ͽTilemap͢䌙فͫ όαϸϫϐϤΨֵ͵οЄϭ͢ ;ͼΘ֢ΠΚͯͥΠΔͭ͵
Ք෭΅ϔϯΨԻ͞ͺͺ̵ ̵̿ͫ͗TilemapΨতΗΞ͜Ѻ̀;氂ͭͼ Tilemap΄च䯤౮ᥝᔰ;ֵ͚ොΨ奧ՕͭΔͯ
Ք෭΄ρЄϸ ̿Tilemapֵ͚তΗ΄݇ᘍ͵Ѻ̀ ͼͼΘΟ͜
ᛔ૩奧Օ
@RyotaMurohoshi
㮆Ո᪁ޱ樄咲ᘏͽͯѺ ͩΩοЄϭΨ֢ͼ͚ΔͯѺ
None
None
None
෭Android΄տ Unity᮱ͽͩΩͩ;ΚͼΔͯ • UniBook6 Hello Programmable Tile! • UniBook8 TilemapConverterͽΌTilemap΄πЄϖ
• ଙ๛LT2016 TileMapEditor΅͚͚ʹѺ Θ͜ݘͥ͵ΩͽΌͷΙͧ抎Δͥͼ͚͚ͽͯѺ
Ք෭֢ΡΘ΄Ѻ
ϔϯ : 奧Օ
氂
UnityϝЄυϴЀ • Tilemap΅Unity 2017.2ͽ䌙ف • ͵Ͷ奞͚͡ද࠺独ץྋͫ͢ͼ͚Ρ΄ͽ̵๋ෛUnityവ䅏
Tilemap΅͚ͥͺ͡΄䯤౮ᥝᔰΨ奲ΕݳΥͱͼֵ͜ 1. Sprite(ኮ؟) 2. Tileίψϐϕ 3. Tile Pallete 4. Tile樛昧οЄϭηϣυδμϕ
Tilemap΄䯤౮ᥝᔰ΄奧Օ ΅ͮΔΠ
ᥝᔰ1 Sprite(ኮ؟) • Tilemap΄1ψϸ(๋ੜ΄Ꭵ୵毎ऒ)ᤒᐏͯΡኮ؟ίψϐϕ • ͚ͥͺ͡戔ਧΨͯΡᥝ͘͢Π • ᥝͶ͵Οړۆ • Pixel
Per Unit • Collider
ᥝᔰ2 Tileίψϐϕ • Tileμ϶φ΄ίψϐϕ(ScriptableObject) • SpriteΨ݇ᆙͭ͵Π̵ᜋ΄ఘ䁭Ψכ೮ͭ͵ΠͯΡ • Tilemapͽ΅ͩ΄TileίψϐϕΨTilemapӾ΄ψϸᯈᗝ • Tileμ϶φ΄憭μ϶φ΅TileBaseμ϶φ
• TileBaseμ϶φΨ姅ಥͭ͵μ϶φΨ֢Π̵͚Σ͚ΣͽͣΡ
ΩͽTileAsset?ϮϷϐϕ΅Ҙ ψϸ΅Spriteͽ΅ͥTileΨᗝͥ ͘Ρኮ؟Ψ૧๊ͭ͞͵͚;̵ͣ Tile΄݇ᆙͯΡSpriteΨ૧๊ͭ͞ΡͶͧͽOKѺ
ᥝᔰ3 TilePallete • TileίψϐϕΨጭ梍ͯΡϞϹϐϕ • τЄЀӤTilePalleteጭ梍ͭ͵TileίψϐϕΨ晝䝑ͭᯈᗝͯΡ • Ꭵ୵ൈኮ̵晝䝑̵ڷᴻ̵䂍ΠͺΌͭͿ΄ϯЄϖ晝䝑Θ • ϤϺυδμϕٖ΅Tilemap΄ϤϹϢήϣ;ͭͼכਂͫΡ
• Tile Pallete Windowͽ䜷͜
ᥝᔰ4 Tile樛昧οЄϭηϣυδμϕ • ͩͩΔͽ奧Օͭ͵Κͺ΅ίψϐϕͽτЄЀӤ΅ᗝ͚͡ • τЄЀӤ΅ེ΄ԫͺΨ֢౮ • GridοЄϭηϣυδμϕ • TilemapοЄϭηϣυδμϕ
Tilemap΅͚ͥͺ͡΄䯤౮ᥝᔰΨ奲ΕݳΥͱͼֵ͜ 1. Sprite(ኮ؟) 2. Tileίψϐϕ 3. Tile Pallete 4. Tile樛昧οЄϭηϣυδμϕ
Tilemap΄䯤౮ᥝᔰ΄奧Օ ͠ΥΠ
ͩͩ͡Ο΅ϔϯΨԻ͞ͺͺ Κͼ͚ͣΔͯѺ
ͩͩ͡ΟचጱTilemap΄ֵ͚ො ΅ͮΔΠ
1: Sprite΄ӥ伛㯪
1: Sprite΄ӥ伛㯪 (1) ϪαЀϕ΅ • 1䶅΄ኮ؟愢හ΄Sprite͘͢Άړۆ • Pixels Per UnitΨ晒ڔ
• ColliderΨ抠ෆ
ϔϯ
Pixels Per Unit • Sprite͢τЄЀͽൈኮͫ͵檭΄य़ͣͫΨ抠ෆͯΡ • UnityӤͽ΄槱ͫ1ፘ୮ͯΡϡμψϸහ • 1旽͢32ϡμψϸ΄ኮ؟͘͢͵;ͭͼ̵ •
Pixels Per Unit͢32 : य़ͣͫ΅1 • Pixels Per Unit͢16 : य़ͣͫ΅2 • ྋො୵΄ኮ؟Ο1旽΄ϡμψϸහΨPixels Per Unit
Sprite Editor΄Edit Physics Shape Sprite΄Collider΄εϐυΨ抠℄Ѻ Tilemapͽ΄ളڣਧ͚͚͢ఽͮѺ h"ps:/ /qiita.com/RyotaMurohoshi/items/a4944ba2f4fd7c00e8ec
None
Step 2
2 : TilePallete΄֢౮
ϔϯ
2 : TilePallete΄֢౮ 1. ϮϘϲЄ΄ Window > Tile PalleteΨ晝䝑 2.
Tile Pallete Window΄ૢӤ΄̿Create New Pale5èΨೀӥ 3. NameϞϹϐϕݷΨفێͭCreateϩόЀΨೀͯ
Step 3
3 : TileAsset΄֢౮
3 : TileAsset΄֢౮ TilepalletespriteΨϖ϶ϐν&ϖϺϐϤͽ Tileίψϐϕ֢౮&TileίψϐϕΨPalleteጭ梍Ѻ
Step 4
4 : οЄϭηϣυδμϕ΄֢౮
4 : οЄϭηϣυδμϕ΄֢౮ Create > 2D Object > Tilemapͽ GridοЄϭηϣυδμϕ;
TilemapοЄϭηϣυδμϕ͢Ѻ
ϔϯ
ͳʹ΄πЀϪЄϕ΄抍ก
GridπЀϪЄϚЀϕ • Cell Size : ψϸ΄य़ͣͫ • Cell Gap :
ψϸ;ψϸ΄ᵐ樌΄य़ͣͫ • Cell Swizzle : Tilemap΄ଘᶎҁϔϢζϸϕ΅XYଘᶎ) ͩ΄戔ਧ΅̵ͯΏͼ΄ৼTilemapοЄϭηϣυδμϕ䌏ͭͼ晒䖕
TilemapRendererπЀϪЄϚЀϕ ൈኮ戔ਧΨݪΠSpriteRenderer;و᭗΄殻ፓΨ೮ͺ • Sor%ng Layer • Order In Layer •
Mask Interac%on ᙧวϹαϱЄ独ڹᶎϹαϱЄͳͭͼκϰ϶μόЄҁSpriteRenderer҂Ε͵͚ൈኮ殼ଧΨګகͽͣΡ
TilemapπЀϪЄϚЀϕ ͿͩͿ΄Tile͘͢Ρ΄͡΄ఘ䁭Ψ೮ͺ ᜋΚίЀθЄͿ΄ൈኮ独ᯈᗝ樛ͯΡ戔ਧ殻ፓΘ
Step 5
5 : Tilemap΄ൈኮ
ϔϯ
5 : Tilemap΄ൈኮ1 • Ac$ve Tilemap͢䌏Tilemapͼ͚Ρ͡嘦扯 • ϣ϶τίαπЀΨ晝䝑 • ൈኮͭ͵͚όαϸΨ晝䝑
5 : Tilemap΄ൈኮ2 Scene Windowͽ ൈኮͭ͵͚䁰ಅθЄϊϸΨ㵕ͭ͡ૢμϷϐμ ڥ䱛ᚆΚτϴЄϕθϐϕΨ洑ֵͭͼιЀιЀϫϐϤΨ֢Σ͜Ѻ
τϴЄϕθϐϕ1 • s : 塅㾨晝䝑 • m : 塅㾨晝䝑ͭ͵᮱ړΨᑏ㵕 •
b : 晝䝑Ӿ΄όαϸͽൈኮ • u : Ꭵ୵䂍ΠͺΌͭ • g : 毎ऒ䂍ΠͺΌͭ • shi+ / d : ڷᴻ
τϴЄϕθϐϕ2 • Ctrl(Wim) / Cmd(Mac) Θͭͥ΅ i : φϪαϕ毎ऒ晝䝑 •
. (Win) / } (Mac) 䦒懯ࢧΠ90ଶࢧ敢 • , (Win) / { (Mac) ݍ䦒懯ࢧΠ90ଶࢧ敢 • Shi; + . (Win) / Shi; + } (Mac) ࣮ፗොݻݍ敢 • Shi; + , (Win) / Shi; + { (Mac) ଘොݻݍ敢
Step 6
Step 6 : Collider΄戔ਧ • TilemapCollider΄՞Ө • CompositeCollider΄՞Ө • TilemapCollider΄Used
By CompositeΨON Sprite΄Physics Shape΄戔ਧͩͩ͢ͽኞͣΡѺ
ͩͩΔͽͽचጱTilemap΄ֵ͚ො 奰ΥΠ
͚ͥͺ͡愆᪃抍ก
戔ਧΨૡॢͯΆ̵IsometricTilemapΘ֢ΡѺ
None
ϔϯ
• Grid • Cell Size : 0.75 • Scale :
0.5 • Tilemap • Transform Rota<on : 45 • Tilemap Rota<on : 315 • Tilemap Scale Y : 2 • Sort Order : Top Right
TilemapοЄϭηϣυδμϕ΅愢හ̵ϹαϱЄΨ֢ΡѺ
ϔϯ
͚ͥͺ͡愆᪃抍ก ͠ΥΠ
Θ;䮭TilemapΨ֢Σ͜Ѻ ͯͯ͠Η϶αϣ϶Ϸ
2d-extras
2d-extras • Unityلୗ϶αϣ϶Ϸ • GitHub΄Unity-Technologies/2d-extras • 2DͼݷڹͶͧͿΔͶTile͚ͭ͡ΞѺ • ͘Ρᑕଶ౮ᆧͭ͵Ο̵ίψϐϕφϕίᤈͥΟ͚ͭ h"ps:/
/github.com/Unity-Technologies/2d-extras
2d-extras΄Ӿ΄μ϶φᗭ᩻͢䔶ێѺ ͚ͥͺ͡奧ՕѺ
TerrainTile
ϔϯ
ͩཿ͚ͭͥͽͯ͡Ѻ
֢ΠොѺ
TerrainTile΄惾㯎 • ScriptableTile΄1圵 • TerrainTile΅TileBaseΨ姅ಥͭ͵μ϶φ • 15圵΄SpriteΨጭ梍ͯΡ • ޮ㾨΄Tile΄ᇫ丆ݳΥͱͼ͚͚ఽͮSpriteΨᤒᐏ •
ᇫ丆ݳΥͱͼSprite圵气晝䝑 • ᇫ丆ݳΥͱͼSpriteΨࢧ敢
TerrainTile΄惾㯎 15圵΄Sprite΅ྋͭͥ戔ਧ͚ͭ;͚͚ͧ 托ͭͥ΅ӥΨ h"ps:/ /qiita.com/RyotaMurohoshi/items/1629c50a9d9f70f31c83
ColorSmoothBrush
ColorSmoothBrush΄ֵ͚ො 1. TintedTilemapτδЄύЄͽMaterialΨ֢౮ 2. ↑ΨTilemap՞Ө 3. BrushΨTintedBrushͭͼ̵ᜋΨ戔ਧ 4. Scene WindowͽᜋΨ䂍Π͵͚䁰ಅΨμϷϐμ
՜ΘڥBrush • LineBrush : 娄ΨͧΡΚͺ • Cordina1eBrush : θЄϊϸ͘͢Ρ;ͩΣ΄ଷ䰤͢Υ͡ΡΚͺ •
PrefabBrush : ਧͭ͵ϤϹϢήϣΨψϸᯈᗝͽͣΡΚͺ
2d-extras Tilemapֵ͜ΟΆ ΕΩֵͼ͚ͣΔͭΝ͜Ѻ
Tilemap̵ֵ͚͵ͥΠΔͭ͵͡Ѻ Ω;ֵ͚ͥতΗΟΡ䶲ͭ͢ͼͣΔͭ͵͡Ѻ
̵ͫ͗TilemapΨতΗΞ͜Ѻ by @RyotaMurohoshi 2018/01/31() Gotanda.unity #4