game: end day

This commit is contained in:
ryan 2025-02-18 05:18:24 +08:00
parent 0eecafdfa8
commit f13bbf54fb
4 changed files with 55 additions and 5 deletions

View file

@ -7316,7 +7316,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!114 &96628618
MonoBehaviour:
m_ObjectHideFlags: 0
@ -34464,7 +34464,19 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 982606276}
m_OnClick:
m_PersistentCalls:
m_Calls: []
m_Calls:
- m_Target: {fileID: 1127196874}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: EndDay
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &982606276
MonoBehaviour:
m_ObjectHideFlags: 0
@ -34654,6 +34666,18 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
- m_Target: {fileID: 96628617}
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
m_MethodName: SetActive
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
--- !u!114 &983476096
MonoBehaviour:
m_ObjectHideFlags: 0
@ -37665,7 +37689,7 @@ MonoBehaviour:
m_OverrideVoxelSize: 0
m_VoxelSize: 0.06666667
m_MinRegionArea: 2
m_NavMeshData: {fileID: 23800000, guid: de28d0eec1a703e4fa799a7b4c7933fa, type: 2}
m_NavMeshData: {fileID: 23800000, guid: df5edc2658f716041a96905132364a2d, type: 2}
m_BuildHeightMesh: 1
--- !u!114 &1127196874
MonoBehaviour:

View file

@ -72,7 +72,7 @@ public class DayManager : MonoBehaviour
Debug.Log(Backend.instance.User.daysPlayed);*/
/*shiftManagerScript.AllowShiftStart();*/
Debug.Log("You can start another shift!");
GameManager.instance.EndDay();
doneAShift = false;
}
}

View file

@ -9,7 +9,7 @@ using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
/// <summary>
@ -64,4 +64,10 @@ public class GameManager : MonoBehaviour
Debug.LogError("NPC Script not found on NPC");
}
}
public void EndDay()
{
SceneManager.LoadScene("UiScene");
Destroy(gameObject);
}
}

View file

@ -5,6 +5,7 @@
* Main Menu scene button interactions
*/
using System;
using System.Collections;
using System.Collections.Generic;
using Supabase.Gotrue;
@ -120,4 +121,23 @@ public class MenuButtons : MonoBehaviour
Application.Quit();
Debug.Log("Quitting game");
}
void Start()
{
Backend.instance.menuButtons = this;
if (Backend.instance.Session != null)
{
LoadProfileData();
authPanel.SetActive(false);
menuPanel.SetActive(true);
profilePanel.SetActive(false);
}
else
{
authPanel.SetActive(true);
menuPanel.SetActive(false);
profilePanel.SetActive(false);
}
}
}