Petition-to-the-Gods-V3/Assets/Scripts/Server/ServerGameSticksPanel.cs
chiyulin0314 7e8fa7732a fix Q25
遊戲3的角度
2025-11-20 07:30:00 +08:00

66 lines
1.8 KiB
C#

using System.Collections;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;
public class ServerGameSticksPanel : MonoBehaviour
{
public static ServerGameSticksPanel Instance;
private IncenseGameManager gameManager;
private CustomerReportSystem customReportScript;
private void Awake()
{
Instance = this;
gameManager = gameObject.GetComponentInChildren<IncenseGameManager>(includeInactive: true);
customReportScript = gameObject.GetComponentInChildren<CustomerReportSystem>(includeInactive: true);
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
gameManager.OnCountdownFinished = OnCountdownFinished;
customReportScript.OnCustomerReportConfirmed = OnCustomerReportConfirmed;
}
private void OnCountdownFinished()
{
//倒數時間到,直接跳轉頁面
if (ServerWorkSceneController.Instance)
{
ServerWorkSceneController.Instance.processStep(17);
}
}
private void OnCustomerReportConfirmed(int[] values)
{
if (values.Length < 3) { return; }
if (ServerWorkTopRightScore.Instance == null) { return; }
GlobalData.VIRTUE_SCORE = values[0];
GlobalData.KARMA_SCORE = values[1];
GlobalData.SINCERITY_SCORE = values[2];
ServerWorkTopRightScore.Instance.UpdateScoreVals();
//跳轉頁面
if (ServerWorkSceneController.Instance)
{
ServerWorkSceneController.Instance.processStep(17);
}
}
public void OnReceivedResult(int angle)
{
//更新角度
gameManager.SetReceivedAngle(angle);
}
// Update is called once per frame
void Update()
{
}
}