Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StartScript : MonoBehaviour {
- void Start () {
- FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("my_url");
- FirebaseDatabase.DefaultInstance
- .GetReference("/")
- .GetValueAsync().ContinueWith(task => {
- if (task.IsFaulted)
- {
- // Handle the error...
- }
- else if (task.IsCompleted)
- {
- DataSnapshot snapshot = task.Result;
- // Do something with snapshot...
- if (snapshot.Value.Equals("none")) {
- SceneManager.LoadScene(1);
- }
- }
- });
- }
- void Update () {
- }
- public class StartScript : MonoBehaviour {
- bool check = false;
- string link = "";
- // Use this for initialization
- void Start () {
- FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("myurl");
- FirebaseDatabase.DefaultInstance
- .GetReference("/")
- .GetValueAsync().ContinueWith(task => {
- if (task.IsFaulted){
- }
- else if (task.IsCompleted)
- {
- DataSnapshot snapshot = task.Result;
- link = snapshot.Value.ToString();
- }
- check = true;
- });
- }
- // Update is called once per frame
- void Update () {
- if (check == true) {
- if (link.Equals("none")) {
- SceneManager.LoadScene("Scene1");
- }
- }
- }
Add Comment
Please, Sign In to add comment