Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Unity Beginner HandsOn
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
swingin.joe.221
April 21, 2019
370
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Unity Beginner HandsOn
Image Only
swingin.joe.221
April 21, 2019
More Decks by swingin.joe.221
See All by swingin.joe.221
Unityハンズオン0505
ryudilla
0
77
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
480
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
Ruling the World: When Life Gets Gamed
codingconduct
0
350
Mobile First: as difficult as doing things right
swwweet
225
10k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Docker and Python
trallard
47
4.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Transcript
Unityハンズオン プログラミング初心者がゲームを作るま でやる! by @SJoe221
自己紹介 柏木 龍太 Github:https://github.com/RyuDilla Twitter:@SJoe221 Facebook:ryuta.kashiwagi ・3年目のエンジニアです。 ・趣味でUnityを使ってゲームを作ってます。 ・技術的にはUnity(ゲーム)/Webフロント・バックエンド に興味があります。
時間割 • 今日やること発表(5分) • 自己紹介(5分) • ゲームづくりハンズオン前半(45分) • 休憩(15分) •
ゲームづくりハンズオン後半(45分) • クロージング(5分)
詳細な時間割 • 前半45分 - ゲームシーン作成(20分) 13:10~13:30 - 画面遷移とUI (20分) 13:30~13:50
• 後半45分 - スコアマネージャーの実装 (20分) 14:00~14:20 - サウンドマネージャーの実装(10分) 14:20~14:30 - ランキング機能の実装 (15分) 14:30~14:45
今日やること コリントゲームを作る! こんな感じのゲームを作ります。 主な機能 ・プレイヤーの入力受付 ・基本的なUI ・サウンド再生機能 ・スコア管理機能 ・オンラインランキング機能 サンプルゲームのURL
https://unityroom.com/games/simple_corinth_game
今日やらないこと ・C#の基本的な文法(ゲームを作りきることが 目的だから) ・アニメーションの制御 ・ゲームの面白さ論を考える https://www.amazon.co.jp/exec/obidos/ASIN/4844366084/maple61801-22/ UnityではじめるC#
なぜコリントゲームなのか? ゲームメカニクス(ゲームの面白さの核とな る部分)を作るのが簡単なので、ゲームを 作る上で基本となる機能の実装に集中でき るから。 「ハードルは低ければ低いほど良い。」by 梅原大吾
準備 • Unityのインストール [バージョン3.12] • 配布アセットのダウンロード [githubのurl.........................]
Stage1 ゲームメカニクス ~ゲームの仕掛けをつくる~
Unityエディターについて ヒエラルキー シーンビュー プロジェクト インスペクター
Unityエディターについて ヒエラルキー シーンビュー プロジェクト インスペクター
コンポーネントについて オブジェクト C#スクリプト 物理演算 位置情報 コンポーネント(部品) ・入力を受け付ける(スクリプト) ・重力を受ける(物理演算) ・移動・回転できる(位置情報)
Transformについて ・Position:x軸 y軸 z軸で表される座標 ・Rotation:x軸 y軸 z軸に対してどれだけ 傾いているかを示す ・Scale:x軸 y軸
z軸方向に対してどれだ け大きいかを示す
Stage1 ゲームメカニクス ステージとボールを用意
Stage1 ゲームメカニクス ステージを傾けます! お待ちかねのC#によるコーディングです。
Stage1 ゲームメカニクス using System.Collections; using System.Collections.Generic; using UnityEngine; public class
StageController : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } } ゲームシーンが表示されてから最初に実行される処理 毎フレーム実行される処理 StageController.cs
Stage1 ゲームメカニクス using System.Collections; using System.Collections.Generic; using UnityEngine; public class
StageController : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { // プレイヤーの入力を取得して、変数に保持 float inputHorizontal = Input.GetAxis("Horizontal"); float inputVertical = Input.GetAxis("Vertical"); // プレイヤーの入力値をもとに、オブジェクトの角度を変更 transform.Rotate(new Vector3(0f, 0f, (inputHorizontal * -1.0f))); transform.Rotate(new Vector3(inputVertical, 0f, 0f)); } } StageController.cs
Stage1 ゲームメカニクス • ゴール判定の実装 コライダー(あたり判定) コライダー(あたり判定)
Stage1 ゲームメカニクス • ゴール判定の実装 コライダー(あたり判定) コライダー(あたり判定) 衝突
≒コリントゲーム完成!! では、残りの細かい部分を作りこ んでいきましょう!! ゲームメカニクス完成!
Stage2 シーンとUI ~画面遷移とユーザーインターフェース~
Stage2 UIとシーン Scene スタートシーン ゲームシーン ゲームオーバーシーン リザルトシーン
Stage2 UIとシーン めんどくさい!!
Stage2 UIとシーン Scene スタートシーン ゲームシーン ゲームオーバーシーン リザルトシーン シーンコントローラー
Stage3 スコアマネージャー ~プレイ時間とポイントの管理~
Stage3 スコアマネージャー Scene 敵を倒す コインゲット コイン盗まれる スコアが変更されるきっかけ
Stage3 スコアマネージャー Scene 敵を倒す コインゲット コイン盗まれる スコアが変更されるきっかけ スコアを入れる箱A スコアを入れる箱B
Stage3 スコアマネージャー わかりづらい!!
Stage3 スコアマネージャー Scene 敵を倒す コインゲット コイン盗まれる スコアが変更されるきっかけ スコアマネージャー
Stage3 スコアマネージャー するどい方むけのお話
Stage3 スコアマネージャー シングルトンクラス スコアマネージャーA スコアマネージャーB
Stage3 スコアマネージャー シングルトンクラスについて スコアマネージャーA スコアマネージャーB シングルトン
Stage4 サウンドマネージャー ~BGM・SEの再生~
Stage4 サウンドマネージャー サウンドマネージャーはスコアマネージャーの兄 スコアマネージャー サウンドマネージャー シングルトン シングルトン
Stage4 サウンドマネージャー サウンドマネージャーはスコアマネージャーの兄 スコアマネージャー サウンド マネージャーC シングルトン シングルトン スコアマネージャーB サウンドマネージャー
参考資料まとめ ・【Unity、WebGL】なるべく簡単にオンラインランキング機能をつ けるサンプル https://blog.naichilab.com/entry/webgl-simple-ranking ・NCMBバックエンド https://mbaas.nifcloud.com/doc/current/introduction/quickst art_unity.html ・今回のハンズオンで作ったゲームのソースコード http:// https://github.com/RyuDilla/corinth_game
・グーグルフォント https://fonts.google.com/
おわりに
今回のハンズオンにご参加いただき ありがとうございました