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
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
76
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
670
Discover your Explorer Soul
emna__ayadi
2
1.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
520
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
460
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
How STYLIGHT went responsive
nonsquared
100
6.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
Agile that works and the tools we love
rasmusluckow
331
22k
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/
おわりに
今回のハンズオンにご参加いただき ありがとうございました