「Unity/Firebase/Realtimedatabase」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→Realtimedatabaseとは) |
|||
行3: | 行3: | ||
https://firebase.google.com/download/unity?hl=ja | https://firebase.google.com/download/unity?hl=ja | ||
+ | |||
+ | ==サンプル== | ||
+ | SampleScene.cs | ||
+ | <pre> | ||
+ | using System.Collections; | ||
+ | using System.Collections.Generic; | ||
+ | using UnityEngine; | ||
+ | |||
+ | using Firebase; | ||
+ | using Firebase.Database; | ||
+ | using Firebase.Unity.Editor; | ||
+ | |||
+ | public class SampleScene : MonoBehaviour | ||
+ | { | ||
+ | void Start() | ||
+ | { | ||
+ | // Get the root reference location of the database. | ||
+ | DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference; | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
+ | 参考:https://firebase.google.com/docs/database/unity/retrieve-data?hl=ja |
2020年11月13日 (金) 19:40時点における版
Realtimedatabaseのインストール
FirebaseDatabase.unitypackageをAssets/Importからインストールする
https://firebase.google.com/download/unity?hl=ja
サンプル
SampleScene.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; using Firebase; using Firebase.Database; using Firebase.Unity.Editor; public class SampleScene : MonoBehaviour { void Start() { // Get the root reference location of the database. DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference; } }
参考:https://firebase.google.com/docs/database/unity/retrieve-data?hl=ja