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
370
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
630
Odin Validationはいいぞ!
ryotamurohoshi
2
860
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
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
7
690
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
140
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
13k
SDNという名のデータプレーンプログラミングの歴史
ebiken
PRO
2
130
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
560
複雑なState管理からの脱却
sansantech
PRO
1
160
強いチームと開発生産性
onk
PRO
36
12k
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
Storybook との上手な向き合い方を考える
re_taro
5
860
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
310
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Teambox: Starting and Learning
jrom
133
8.8k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Why Our Code Smells
bkeepers
PRO
334
57k
A designer walks into a library…
pauljervisheath
204
24k
Building Your Own Lightsaber
phodgson
103
6.1k
Adopting Sorbet at Scale
ufuk
73
9.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
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