72 lines
1.8 KiB
C#
72 lines
1.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ServerGameFinalSurveyPanel : MonoBehaviour
|
|
{
|
|
public static ServerGameFinalSurveyPanel Instance;
|
|
|
|
public StarRating val1StarRating;
|
|
public StarRating val2StarRating;
|
|
public StarRating val3StarRating;
|
|
public TMP_Text text1Text;
|
|
|
|
public TMP_Text scoreText;
|
|
public Button okButton;
|
|
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
if (okButton)
|
|
{
|
|
okButton.onClick.AddListener(okButton_onClicked);
|
|
}
|
|
|
|
//讓星星按鈕不能被點擊
|
|
val1StarRating.SetNotInteractable();
|
|
val2StarRating.SetNotInteractable();
|
|
val3StarRating.SetNotInteractable();
|
|
|
|
loadSurveyData();
|
|
updateServerReport();
|
|
}
|
|
|
|
private void okButton_onClicked()
|
|
{
|
|
if (ServerWorkSceneController.Instance)
|
|
{
|
|
ServerWorkSceneController.Instance.processStep(11);
|
|
|
|
}
|
|
}
|
|
|
|
public void loadSurveyData()
|
|
{
|
|
val1StarRating.SetRating(GlobalData.SURVEY_STAR1);
|
|
val2StarRating.SetRating(GlobalData.SURVEY_STAR2);
|
|
val3StarRating.SetRating(GlobalData.SURVEY_STAR3);
|
|
text1Text.text = GlobalData.SURVEY_TEXT;
|
|
}
|
|
|
|
public void updateServerReport()
|
|
{
|
|
string text =
|
|
@$"聖杯數:{GlobalData.CUP_YES_COUNT}
|
|
笑杯數:{GlobalData.CUP_NOT_SURE_COUNT}
|
|
蓋杯數:{GlobalData.CUP_NO_COUNT}
|
|
賜籤數:{GlobalData.WORD_COUNT}
|
|
客戶陰德值:{GlobalData.VIRTUE_SCORE}
|
|
客戶業力值:{GlobalData.KARMA_SCORE}
|
|
客戶誠意度:{GlobalData.SINCERITY_SCORE}
|
|
神力值:{GlobalData.GODLY_POWER}";
|
|
scoreText.text = text;
|
|
}
|
|
}
|