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
Amazon_CloudWatch_ログ異常検出_導入ガイド
tsujiba
4
1.6k
独自ツール開発でスタジオ撮影をDX!「VLS(Virtual LED Studio)」 / dx-studio-vls
cyberagentdevelopers
PRO
1
180
日経電子版におけるリアルタイムレコメンドシステム開発の事例紹介/nikkei-realtime-recommender-system
yng87
1
500
ユーザーの購買行動モデリングとその分析 / dsc-purchase-analysis
cyberagentdevelopers
PRO
2
100
Shift-from-React-to-Vue
calm1205
3
1.3k
ガバメントクラウド単独利用方式におけるIaC活用
techniczna
3
270
スプリントゴールにチームの状態も設定する背景とその効果 / Team state in sprint goals why and impact
kakehashi
2
100
IaC運用を楽にするためにCDK Pipelinesを導入したけど、思い通りにいかなかった話
smt7174
1
110
君は隠しイベントを見つけれるか?
mujyun
0
290
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
AWSコンテナ本出版から3年経った今、もし改めて執筆し直すなら / If I revise our container book
iselegant
15
4k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
425
64k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to Think Like a Performance Engineer
csswizardry
19
1.1k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
A designer walks into a library…
pauljervisheath
202
24k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
It's Worth the Effort
3n
183
27k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
680
Building Adaptive Systems
keathley
38
2.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
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