Commit 51c824b8 authored by nk161690's avatar nk161690

Main scene

load into main scene upon successful signin
parent 80baba42
using Newtonsoft.Json;
using Photon.Pun;
using Photon.Realtime;
using System.Collections;
using System.Collections.Generic;
using System.Net.Http;
using TMPro;
using UnityEngine;
......
......@@ -3,6 +3,7 @@ using Photon.Pun;
using Photon.Realtime;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class FacebookLogin : MonoBehaviour
{
......@@ -61,6 +62,8 @@ public class FacebookLogin : MonoBehaviour
string accessToken = AccessToken.CurrentAccessToken.TokenString;
Debug.Log("Facebook Login Successful! Access Token: " + accessToken);
SceneManager.LoadScene("Main");
// Continue with Photon authentication
OnFacebookLoggedIn();
......
......@@ -4,7 +4,6 @@ using System.Net.Http.Headers;
using System.Net.Http;
using System.Text;
using UnityEngine;
using static System.Collections.Specialized.BitVector32;
public static class Log
{
......
......@@ -11,7 +11,7 @@ public class PhotonServer : MonoBehaviourPunCallbacks
{
base.OnConnectedToMaster();
Debug.Log("Connected to Photon!");
message.text = "Login successful! Connected to Photon.";
message.text = "Login successful!<br>Connected to Photon.";
}
public override void OnDisconnected(DisconnectCause cause)
......
......@@ -503,7 +503,6 @@ GameObject:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420033}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
......@@ -585,19 +584,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &519420033
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 873ca38bdc936c944a2ffa4cb281ce7c, type: 3}
m_Name:
m_EditorClassIdentifier:
message: {fileID: 0}
--- !u!1 &727956155
GameObject:
m_ObjectHideFlags: 0
......
This diff is collapsed.
using Photon.Pun;
using System;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using static Log;
public class UserSessionManager : MonoBehaviour
......@@ -22,12 +22,11 @@ public class UserSessionManager : MonoBehaviour
{
if (currentSession != null)
{
// Set the logout time for the current session
currentSession.LogoutTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm");
LogLoginSession(currentSession);
// Reset the current session
currentSession = null;
PhotonNetwork.Disconnect();
SceneManager.LoadScene("Login");
}
}
}
......@@ -8,4 +8,7 @@ EditorBuildSettings:
- enabled: 1
path: Assets/Scenes/Login.unity
guid: 2cda990e2423bbf4892e6590ba056729
- enabled: 1
path: Assets/Scenes/Main.unity
guid: 2cc858c23c576ec44837e5ff1889e937
m_configObjects: {}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment