fix Q23
串接頭也不回離開的評分
This commit is contained in:
parent
1930fbeb6d
commit
1009485339
File diff suppressed because it is too large
Load Diff
@ -15,17 +15,16 @@ public class ClientWorkMessageResultExitSceneController : MonoBehaviour
|
|||||||
public VideoPlayer step2VideoPlayer;
|
public VideoPlayer step2VideoPlayer;
|
||||||
public RawImage step2RawImage;
|
public RawImage step2RawImage;
|
||||||
|
|
||||||
|
private SurveyManager surveyManager;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
surveyManager = step1Panel.GetComponentInChildren<SurveyManager>(includeInactive: true);
|
||||||
}
|
}
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
if (step1SubmitButton)
|
|
||||||
{
|
|
||||||
step1SubmitButton.onClick.AddListener(step1SubmitButton_onClicked);
|
|
||||||
}
|
|
||||||
if (step2VideoPlayer != null)
|
if (step2VideoPlayer != null)
|
||||||
{
|
{
|
||||||
// 設置影片結束事件
|
// 設置影片結束事件
|
||||||
@ -43,13 +42,23 @@ public class ClientWorkMessageResultExitSceneController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
processStep(1);
|
processStep(1);
|
||||||
|
surveyManager.OnSurveyConfirmed = OnSurveyConfirmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void step1SubmitButton_onClicked()
|
private void OnSurveyConfirmed(int val1, int val2, int val3, string text)
|
||||||
{
|
{
|
||||||
if (ClientMessageHandler.Instance)
|
if (ClientMessageHandler.Instance)
|
||||||
{
|
{
|
||||||
ClientMessageHandler.Instance.SendMessageToServer("workProcess", "survey_ok");
|
|
||||||
|
GameMessageSurvey msgObj = new GameMessageSurvey {
|
||||||
|
val1 = val1,
|
||||||
|
val2 = val2,
|
||||||
|
val3 = val3,
|
||||||
|
text1 = text
|
||||||
|
};
|
||||||
|
|
||||||
|
string payload = JsonUtility.ToJson(msgObj);
|
||||||
|
ClientMessageHandler.Instance.SendMessageToServer("gameSurvey", payload);
|
||||||
}
|
}
|
||||||
processStep(2);
|
processStep(2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,12 +94,6 @@ public class NetworkMessageHandler : MonoBehaviour
|
|||||||
ServerWorkSceneController.Instance.processStep(9);
|
ServerWorkSceneController.Instance.processStep(9);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "survey_ok":
|
|
||||||
if (ServerWorkSceneController.Instance)
|
|
||||||
{
|
|
||||||
ServerWorkSceneController.Instance.processStep(10);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "continue":
|
case "continue":
|
||||||
if (ServerWorkSceneController.Instance)
|
if (ServerWorkSceneController.Instance)
|
||||||
{
|
{
|
||||||
@ -115,17 +109,18 @@ public class NetworkMessageHandler : MonoBehaviour
|
|||||||
|
|
||||||
if (msgObj != null)
|
if (msgObj != null)
|
||||||
{
|
{
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val1 = msgObj.val1;
|
GlobalData.SURVEY_STAR1 = msgObj.val1;
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val2 = msgObj.val2;
|
GlobalData.SURVEY_STAR2 = msgObj.val2;
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val3 = msgObj.val3;
|
GlobalData.SURVEY_STAR3 = msgObj.val3;
|
||||||
ServerWorkMessageReplyExitSurveyPanel.text1 = msgObj.text1;
|
GlobalData.SURVEY_TEXT = msgObj.text1;
|
||||||
if (ServerWorkSceneController.Instance)
|
if (ServerWorkSceneController.Instance)
|
||||||
{
|
{
|
||||||
ServerWorkSceneController.Instance.processStep(10);
|
//不用馬上跳場警,等到動畫結束自動跳場警
|
||||||
|
//ServerWorkSceneController.Instance.processStep(10);
|
||||||
}
|
}
|
||||||
if (ServerWorkMessageReplyExitSurveyPanel.Instance)
|
if (ServerWorkMessageReplyExitSurveyPanel.Instance)
|
||||||
{
|
{
|
||||||
ServerWorkMessageReplyExitSurveyPanel.Instance.loadData();
|
ServerWorkMessageReplyExitSurveyPanel.Instance.loadSurveyData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,10 +165,6 @@ public class NetworkMessageHandler : MonoBehaviour
|
|||||||
GlobalData.SURVEY_STAR2 = msgObj.val2;
|
GlobalData.SURVEY_STAR2 = msgObj.val2;
|
||||||
GlobalData.SURVEY_STAR3 = msgObj.val3;
|
GlobalData.SURVEY_STAR3 = msgObj.val3;
|
||||||
GlobalData.SURVEY_TEXT = msgObj.text1;
|
GlobalData.SURVEY_TEXT = msgObj.text1;
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val1 = msgObj.val1;
|
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val2 = msgObj.val2;
|
|
||||||
ServerWorkMessageReplyExitSurveyPanel.val3 = msgObj.val3;
|
|
||||||
ServerWorkMessageReplyExitSurveyPanel.text1 = msgObj.text1;
|
|
||||||
if (ServerWorkSceneController.Instance)
|
if (ServerWorkSceneController.Instance)
|
||||||
{
|
{
|
||||||
ServerWorkSceneController.Instance.processStep(19);
|
ServerWorkSceneController.Instance.processStep(19);
|
||||||
|
|||||||
@ -11,7 +11,7 @@ public class ServerGameFinalSurveyPanel : MonoBehaviour
|
|||||||
public StarRating val1StarRating;
|
public StarRating val1StarRating;
|
||||||
public StarRating val2StarRating;
|
public StarRating val2StarRating;
|
||||||
public StarRating val3StarRating;
|
public StarRating val3StarRating;
|
||||||
public TMP_Text text1Text;
|
public TMP_Text surveyText;
|
||||||
|
|
||||||
public TMP_Text scoreText;
|
public TMP_Text scoreText;
|
||||||
public Button okButton;
|
public Button okButton;
|
||||||
@ -52,7 +52,7 @@ public class ServerGameFinalSurveyPanel : MonoBehaviour
|
|||||||
val1StarRating.SetRating(GlobalData.SURVEY_STAR1);
|
val1StarRating.SetRating(GlobalData.SURVEY_STAR1);
|
||||||
val2StarRating.SetRating(GlobalData.SURVEY_STAR2);
|
val2StarRating.SetRating(GlobalData.SURVEY_STAR2);
|
||||||
val3StarRating.SetRating(GlobalData.SURVEY_STAR3);
|
val3StarRating.SetRating(GlobalData.SURVEY_STAR3);
|
||||||
text1Text.text = GlobalData.SURVEY_TEXT;
|
surveyText.text = GlobalData.SURVEY_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateServerReport()
|
public void updateServerReport()
|
||||||
|
|||||||
@ -6,12 +6,12 @@ using UnityEngine.UI;
|
|||||||
public class ServerWorkMessageReplyExitSurveyPanel : MonoBehaviour
|
public class ServerWorkMessageReplyExitSurveyPanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static ServerWorkMessageReplyExitSurveyPanel Instance;
|
public static ServerWorkMessageReplyExitSurveyPanel Instance;
|
||||||
public static int val1;
|
|
||||||
public static int val2;
|
|
||||||
public static int val3;
|
|
||||||
public static string text1;
|
|
||||||
|
|
||||||
|
public StarRating val1StarRating;
|
||||||
|
public StarRating val2StarRating;
|
||||||
|
public StarRating val3StarRating;
|
||||||
public TMP_Text surveyText;
|
public TMP_Text surveyText;
|
||||||
|
|
||||||
public TMP_Text scoreText;
|
public TMP_Text scoreText;
|
||||||
public Button okButton;
|
public Button okButton;
|
||||||
private void Awake()
|
private void Awake()
|
||||||
@ -25,6 +25,14 @@ public class ServerWorkMessageReplyExitSurveyPanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
okButton.onClick.AddListener(okButton_onClicked);
|
okButton.onClick.AddListener(okButton_onClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//讓星星按鈕不能被點擊
|
||||||
|
val1StarRating.SetNotInteractable();
|
||||||
|
val2StarRating.SetNotInteractable();
|
||||||
|
val3StarRating.SetNotInteractable();
|
||||||
|
|
||||||
|
loadSurveyData();
|
||||||
|
updateServerReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void okButton_onClicked()
|
private void okButton_onClicked()
|
||||||
@ -32,14 +40,25 @@ public class ServerWorkMessageReplyExitSurveyPanel : MonoBehaviour
|
|||||||
ServerWorkSceneController.Instance.processStep(11);
|
ServerWorkSceneController.Instance.processStep(11);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadData()
|
public void loadSurveyData()
|
||||||
{
|
{
|
||||||
|
val1StarRating.SetRating(GlobalData.SURVEY_STAR1);
|
||||||
|
val2StarRating.SetRating(GlobalData.SURVEY_STAR2);
|
||||||
|
val3StarRating.SetRating(GlobalData.SURVEY_STAR3);
|
||||||
|
surveyText.text = GlobalData.SURVEY_TEXT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
public void updateServerReport()
|
||||||
void Update()
|
|
||||||
{
|
{
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user