Commit 51c824b8 authored by nk161690's avatar nk161690

Main scene

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