Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
390
Unity 2021.1での Unityパッケージの名称変更について
ryotamurohoshi
0
640
Odin Validationはいいぞ!
ryotamurohoshi
2
870
Tilemapはいいぞ!2020 〜すごいぞ、プロジェクト専用拡張Brush〜
ryotamurohoshi
0
2.3k
Unityでも、新しいC#
ryotamurohoshi
0
1.2k
Riderはいいぞ!
ryotamurohoshi
1
3.3k
Riderのススメ〜俺はRiderここが好き〜
ryotamurohoshi
1
2.3k
Unity開発者に伝えたい.NETのこと
ryotamurohoshi
4
36k
ImportedLinqのススメ
ryotamurohoshi
0
1.3k
Other Decks in Technology
See All in Technology
50以上のマイクロサービスを支えるアプリケーションプラットフォームの設計・構築の後悔と進化 #CNDW2024 / regrets and evolution of application platform
toshi0607
5
620
Kubernetesを知る
logica0419
16
4.3k
asumikamというカンファレンスオーガナイザの凄さを語る / The Brilliance of Asumikam
tomzoh
1
170
レガシーシステムへのDatadog APM導入奮闘記
mtakeya4062
0
130
Microsoft Ignite 2024 Update 1 - AIとIoT関連の最新情報をどこよりも早く!
iotcomjpadmin
0
280
累計2500万着電を支える大規模 電話自動応答サービスのアーキテクチャ / Architecture of a Large-Scale Automated Phone Response Service Supporting 25 Million Cumulative Calls
ymachida
8
4.2k
メインテーマはKubernetes
nwiizo
2
320
RDRAとLLM
kanzaki
4
490
GAS × Discord bot × Gemini で作ったさいきょーの情報収集ツール
ysknsid25
1
400
【ASW21-01】STAMPSTPAで導き出した課題に対する対策立案手法の提案
hianraku9498
0
160
プルリクが全てじゃない!実は喜ばれるOSS貢献の方法8選
tkikuc
17
2.1k
Will multimodal language processing change the world?
keio_smilab
PRO
2
250
Featured
See All Featured
KATA
mclloyd
29
14k
Being A Developer After 40
akosma
87
590k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Happy Clients
brianwarren
98
6.7k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Facilitating Awesome Meetings
lara
50
6.1k
The Cult of Friendly URLs
andyhume
78
6.1k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Optimizing for Happiness
mojombo
376
70k
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