- PromptTextCtrl: 新增SetPromptLocalized支持3秒内实时翻译 - StudentSub2EditorPanel: 3处SetPrompt改SetPromptLocalized - AppraiseSliderCtrl: 评价指标名称用Get()翻译 - WaitResultPanel: 评价等级用Get()翻译避免先闪中文 - EditorAppraiser: 厂区距离提示中厂区名称先Get()翻译 - GameObjectManager: 距离提示用Get()翻译 - StudentSub2EditorPanel: Text_terrainName同步地形名+实时翻译 - SubStart: 车辆列表为空时回退CameraPos定位相机 - 所有UI预制体verticalOverflow改为Overflow(322处) - LocalizationManager/LoginPanel/HistoryPanel/VRTooltip: 移除强制Overflow - 分组错误提示用Get()翻译+新增4条翻译 - 山地作为林地别名在代码回退字典中
107 lines
3.4 KiB
C#
107 lines
3.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using XFramework;
|
|
/// <summary>
|
|
/// 学员端操作完成弹出
|
|
/// 用于显示教员发送的评估结果
|
|
/// 学员可主动退出 并通知教员
|
|
/// </summary>
|
|
public class WaitResultPanel : BasePanel
|
|
{
|
|
const string panelName = "Panel_WaitResultPanel";
|
|
Transform waitText;//等待中提示文字
|
|
Text showLevelText;//显示评价等级
|
|
Text showRemark;//显示教员评语
|
|
|
|
public WaitResultPanel() :base(new UIType("Panel_WaitResultPanel"))
|
|
{
|
|
|
|
}
|
|
|
|
|
|
protected override void InitEvent()
|
|
{
|
|
ActivePanel.FindChildTrans("Button_Close").GetComponent<Button>().onClick.AddListener(CloseButtonOn);
|
|
waitText = ActivePanel.FindChildTrans("Text_wating");
|
|
showLevelText = ActivePanel.FindChildTrans("Text_level").GetComponent<Text>();
|
|
showRemark = ActivePanel.FindChildTrans("Text_remark").GetComponent<Text>();
|
|
}
|
|
|
|
public override void OnStart()
|
|
{
|
|
base.OnStart();
|
|
EventCenter.Instance.AddEventListener<NetAppraiseData>("TeacherSendResult", InjectResult);
|
|
waitText.gameObject.SetActive(true);
|
|
showLevelText.gameObject.SetActive(false);
|
|
showRemark.gameObject.SetActive(false);
|
|
}
|
|
|
|
//注入成绩类
|
|
private void InjectResult(NetAppraiseData netAppraiseData)
|
|
{
|
|
if (netAppraiseData.appraised)//有效评估成绩
|
|
{
|
|
waitText.gameObject.SetActive(false);
|
|
showLevelText.gameObject.SetActive(true);
|
|
string color = "";
|
|
switch (netAppraiseData.appraiseLevel)
|
|
{
|
|
case "优秀":
|
|
color = "FFFF00";
|
|
break;
|
|
case "良好":
|
|
color = "04FF00";
|
|
break;
|
|
case "一般":
|
|
color = "00FFF5";
|
|
break;
|
|
case "较差":
|
|
color = "FF6A00";
|
|
break;
|
|
}
|
|
LocalizationManager.SetFormatted(showLevelText, "<color=#{0}><size=80>{1}</size></color>", color, LocalizationManager.Get(netAppraiseData.appraiseLevel));
|
|
|
|
if (!string.IsNullOrEmpty(netAppraiseData.remark))//有教员评语时 显示教员评语
|
|
{
|
|
showRemark.gameObject.SetActive(true);
|
|
showRemark.text = netAppraiseData.remark;
|
|
}
|
|
}
|
|
else//教员放弃评价 返回初始场景 无需发送结束事件
|
|
{
|
|
FinishedWait();
|
|
}
|
|
}
|
|
|
|
//尝试关闭本界面时
|
|
private void CloseButtonOn()
|
|
{
|
|
if (!showLevelText.gameObject.activeSelf) //未显示成绩 退出提示
|
|
{
|
|
|
|
Push(new PromptWindows()).Change(new PromptWindowInitData(LocalizationManager.Get("是否不再等待教员评价,并返回初始场景?"), ClosePanelAndSend));//弹出提示界面
|
|
}
|
|
else
|
|
{
|
|
ClosePanelAndSend();
|
|
}
|
|
}
|
|
|
|
private void ClosePanelAndSend()
|
|
{
|
|
TCPManager.Instance.SendNetMsg(NetMsgName.StuCloseResPanel);
|
|
FinishedWait();
|
|
}
|
|
|
|
|
|
//结束等待界面
|
|
private void FinishedWait()
|
|
{
|
|
EventCenter.Instance.RemoveEnvetListener<NetAppraiseData>("TeacherSendResult", InjectResult);
|
|
Pop();
|
|
SceneSystem.Instance.SetScene(new StudentLoginScene(LoadSceneType.Login));
|
|
}
|
|
}
|