game: setting up official scenes
authentication and main menu
This commit is contained in:
parent
eb7bfb41b3
commit
4887066959
8 changed files with 6337 additions and 5 deletions
2325
SSLR/Assets/Scenes/Authentication.unity
Normal file
2325
SSLR/Assets/Scenes/Authentication.unity
Normal file
File diff suppressed because it is too large
Load diff
7
SSLR/Assets/Scenes/Authentication.unity.meta
Normal file
7
SSLR/Assets/Scenes/Authentication.unity.meta
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8fe854ce20bb48b47a224673cb413ed9
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -150,9 +150,9 @@ Material:
|
||||||
- _WorkflowMode: 1
|
- _WorkflowMode: 1
|
||||||
- _ZWrite: 1
|
- _ZWrite: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
- _BaseColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
|
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
|
||||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
- _Color: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
|
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
|
||||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||||
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
|
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
|
||||||
|
|
|
@ -3737,7 +3737,7 @@ MonoBehaviour:
|
||||||
daysPlayedText: {fileID: 1149788710}
|
daysPlayedText: {fileID: 1149788710}
|
||||||
peopleHelpedText: {fileID: 983053282}
|
peopleHelpedText: {fileID: 983053282}
|
||||||
accuracyText: {fileID: 912717248}
|
accuracyText: {fileID: 912717248}
|
||||||
profilePicture: {fileID: 0}
|
profilePicture: {fileID: 1277945301}
|
||||||
--- !u!1 &387529325
|
--- !u!1 &387529325
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -17311,7 +17311,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &1696626647
|
--- !u!224 &1696626647
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
3969
SSLR/Assets/Scenes/MainMenu.unity
Normal file
3969
SSLR/Assets/Scenes/MainMenu.unity
Normal file
File diff suppressed because it is too large
Load diff
7
SSLR/Assets/Scenes/MainMenu.unity.meta
Normal file
7
SSLR/Assets/Scenes/MainMenu.unity.meta
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0dead7ea6762a43489aa58bfe36aeb32
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -151,8 +151,14 @@ public class Backend : MonoBehaviour
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void GetProfile(string url, Image targetRenderer)
|
public async void GetProfile(string url, Image targetRenderer)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(url))
|
||||||
|
{
|
||||||
|
Debug.LogError("Profile picture URL is empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Texture2D texture = await GetTextureFromURL(url);
|
Texture2D texture = await GetTextureFromURL(url);
|
||||||
|
|
|
@ -4,6 +4,8 @@ using Supabase.Gotrue;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.SceneManagement;
|
||||||
|
|
||||||
public class MenuButtons : MonoBehaviour
|
public class MenuButtons : MonoBehaviour
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -59,6 +61,8 @@ public class MenuButtons : MonoBehaviour
|
||||||
daysPlayedText.text = user.daysPlayed.ToString();
|
daysPlayedText.text = user.daysPlayed.ToString();
|
||||||
peopleHelpedText.text = totalPeopleHelped.ToString();
|
peopleHelpedText.text = totalPeopleHelped.ToString();
|
||||||
accuracyText.text = $"{accuracy:F2}%";
|
accuracyText.text = $"{accuracy:F2}%";
|
||||||
|
|
||||||
|
GetProfilePicture();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -73,5 +77,19 @@ public class MenuButtons : MonoBehaviour
|
||||||
public void GetProfilePicture()
|
public void GetProfilePicture()
|
||||||
{
|
{
|
||||||
// profilePicture.sprite = Backend.instance.GetProfilePicture("https://fchobpauqasfebohuuam.supabase.co/storage/v1/object/public/Avatar//1739708594780-6156448458035283230_120.jpg");
|
// profilePicture.sprite = Backend.instance.GetProfilePicture("https://fchobpauqasfebohuuam.supabase.co/storage/v1/object/public/Avatar//1739708594780-6156448458035283230_120.jpg");
|
||||||
|
|
||||||
|
if(Backend.instance.User != null && !string.IsNullOrEmpty(Backend.instance.User.profilePictureUrl))
|
||||||
|
Backend.instance.GetProfile(Backend.instance.User.profilePictureUrl, profilePicture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadScene(string scene)
|
||||||
|
{
|
||||||
|
LoadScene(scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void QuitGame()
|
||||||
|
{
|
||||||
|
Application.Quit();
|
||||||
|
Debug.Log("Quitting game");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue