SlideShare a Scribd company logo
1 of 37
Photon Voice ハンズオ
ン
Photon Voiceは何でしょうか?
• Photon Cloudのマルチプレイ技術を応用して、
音声データを転送する技術です
PUNとの関係は?
Photon Voiceは上位互換として、
PUNの機能を全部含めています
今日のハンズオンは…
+
ハンズオンを開始する前に
本日の参考になる資料
https://goo.gl/xKzVUE
• 本日のスライド
• ハンズオンの途中で利用になるApp ID
• P.22スクリプト
• P.25スクリプト
ハンズオンを開始します
新しいプロジェクトを作成
• Unityを起動します
• プロジェクトを作成
します
• そのまま保存します
8
Assetをダウンロードしてインポート
• Asset Storeを開いて
下さい
• 下記のAssetをダウ
ンロードしてくださ
い
– Photon Voice
– Unity Chan
Assetをインポートする
• すべてをインポート
する
デモを削除する
• "DemoVoice"を削除する
フォルダーを用意する
• “Assets”の下に、下記の
フォルダーを作成する
– Demos
• Resources
• Scenes
• Scripts
– それそれの用途は
• Prefab用
• Scene用
• Script用
Sceneと Prefabを用意する
• Sceneファイルを開く
– UnityChan/Scenes/Loco
motion
• UnityちゃんをPrefab化
– ヒエラルキーからUnity
ちゃんを
Demos/Resources/にド
ラッグする
Sceneと Prefabを用意する
• HierarchyからUnity
ちゃんを削除
• 下記のパスでScene
を別名で保存する
– Assets/Demos/Scenes
/Demos
Photon Viewを設定する
• Prefab化したunitychanを選択
して、下記のコンポーネント
を追加する
– Photon View
– Photon Transform View
– Photon Animator View
• Photon ViewのObserved
Componentsに下記のコンポー
ネントを追加して下さい
– Photon Transform View
– Photon Animator View
Photon Transform Viewを設定する
• 下記の項目をチェックして、
設定を調整します
– Synchronized Position
– Synchronized Rotation
• Synchronized Positionの設定
– Interpolate Option: Lerp
– Lerp Speed: 3
• Synchronized Rotationの設定
– Interpolate Option: Lerp
Photon Animator Viewを設定する
• 右の画像のように設定を
調整します
Photon Server設定を編集
• Photonのサーバー設定をクリック
します
– Photon Unity
Networking/Resources/PhotonSer
verSettings.asset
• Photon Cloud を選択して、AppID
をペスト
• “Auto-Join Lobby”をチェックしま
す
ちなみに、AppIDは…
• Photon Cloudサービスを利用する時、紐づく用
のIDです
• Photon Realtime、Photon Voice、Photon Chat
の使用はそれぞれ切り分けでご利用いただけま
す
PhotonControllerを作成
• Hierarchyの中で、空の
オブジェクトを作成する、
後ほどこのオブジェクト
にスクリプトを関連付け
る
– PhotonController
スクリプトを作成
• ScriptフォルダーでC#スクリプトを作成す
る
– RandomMatchmaker.cs
• 下記のコードをペストする
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomMatchmaker : MonoBehaviour {
public GameObject photonObject;
void Start(){
PhotonNetwork.ConnectUsingSettings("0.1");
PhotonVoiceNetwork.Client.DebugEchoMode = false;
}
void OnJoinedLobby(){
PhotonNetwork.JoinRandomRoom();
}
void OnPhotonRandomJoinFailed(){
PhotonNetwork.CreateRoom(null);
}
void OnJoinedRoom(){
PhotonNetwork.Instantiate(
photonObject.name,
new Vector3(0f, 1f, 0f),
Quaternion.identity, 0
);
GameObject mainCamera =
GameObject.FindWithTag("MainCamera");
mainCamera.GetComponent<ThirdPersonCamera>().enabled = true;
}
void OnGUI(){
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
}
スクリプトをオブジェクトに関連付
け
• 先程作成したPhotonControllerに、
この RandomMatchmakerスクリ
プトを関連付ける
• 対象Photon Objectをunitychanに
設定する
Unitychan Control Scriptを編集する
• Unityちゃんの control
scriptを編集する
– UnityChan/Scripts/Unit
yChanControlscriptWit
hRgidBody.cs
コードを編集する
• 開いたスクリプトの中に:
– parent classを
Photon.MonoBehaviour
に変更します
– FixedUpdate()に新たに三行を追
加する
• スクリプトを保存する
- public class UnityChanControlScriptWithRgidBody : MonoBehaviour
+ public class UnityChanControlScriptWithRgidBody : Photon.MonoBehaviour
void FixedUpdate ()
{
+ if (!(photonView.isMine)) {
+ return;
+ }
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
メインカメラ設定を調整
• Hierachyの中から、Main
Cameraを選択する
• “Third Person Camera”の
チェックを外す
保存して実行する
ここまではPUNでした
ここからはPhoton Voiceです
Photon VoiceのAppIDを設定する
• Photonのサーバー設定をクリックしま
す
– Photon Unity
Networking/Resources/PhotonServerS
ettings.asset
• 下の方にPhoton Voice 設定がありまし
て、ここにVoiceのAppIDをペストする
AppIDは間違いないように…
リアルタイム同期とVoiceチャットのAppIDは分け
て使って下さい!
Voice機能を付ける
• Prefab化したUnityちゃんを選
択して下さい、下記のコンポ
ネントを追加して下さい
– Photon Voice Recorder
• すると、下記のコンポネント
も自動的に追加されます、確
認して下さい
– Audio Source
– Photon Voice Speaker
保存して実行する
*同じ空間で二つのデモを実行する際
激しいエコーが発生するかも
気をつけて下さい!
Photon Voiceで何ができる?
• ゲーム内のコミュニケーション
– 別のアプリを利用する必要なくなります
– FPSだけじゃなく、どんなゲームも利用できます
• 参加型VRアプリにとっても最高の交流手段
– 参加者全員がVR空間内で話せるようになります
– ARにも最適な交流手段
忘れないように…
自分で試すの際は
• Photonアカウントを先ず作りましょう
• Photon RealtimeのAppIDを確保する
• Photon VoiceのAppIDを確保する
間違いないように…
こちらはRealtime こちらはVoice
本日のハンズオンは以上です
ご来場ありがとうございました!
サポート情報まとめ
• Photon Voiceドキュメント
http://doc.photonengine.com/ja-jp/voice/
• ヘルプセンター
http://support.photonengine.jp/hc/ja
• コミュニティ
http://support.photonengine.jp/hc/ja/community/topics
• お問い合わせ
developer@photonengine.jp

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

【Photon勉強会】Photon Voice ハンズオン(2016/12/07講演)

Editor's Notes

  1. Photon Voiceを紹介したいと思います 要するにPhoton Cloudのマルチプレイ技術を応用して、音声データを転送する技術です SDKはUnityのAssetとして提供しています すると
  2. PUNとの関係はどうでしょう?多分聞きたくなりますようね これについて じょういこうかん つまりPhoton Voice Assetを利用すると、PUNを使う必要はないです
  3. スペルを間違いないように確認して下さい
  4. ここのスペルは間違いないように入力して下さい。じゃないとこの後のスクリプトはエラーが発生しちゃいます
  5. ここのスペルも注意して下さい。特にMatchmakerは ここが間違えれば後ほどエラーは出ます
  6. Unityちゃんのスクリプトの中には既にカメラを制御するコードが含まれていますから、ここの3rd party camera設定は不要です
  7. ここまでの手順が問題なければ、自分のキャラクターを操縦しながら、他人のキャラクターも見えて来るはずです
  8. ここはすごく重要だからもう一回強調します