This commit is contained in:
yulong 2024-05-16 08:49:39 +08:00
parent 8a823fe5f8
commit 5ba5a27dcc
5 changed files with 536 additions and 738 deletions

View File

@ -1 +1 @@
2024-04-29 13:35:53#'test://;0;7;588;Bearer%20eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI2MDFjZTIwLWJlOTktNGQwMy1hNmVhLTMzYjY1ODkxM2E4YiJ9.JDu85hTysDmhD1WwNNXzJ0o8UtsPDH3ONnMAYXZPBxy2VhzhF51dDpPkPIRftSGO-dyZeQFCgWkU5Nj6gx1AoQ;/'| 2024-04-29 13:35:53#'test://;0,试卷id,userId,username;Bearer%20eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6ImI2MDFjZTIwLWJlOTktNGQwMy1hNmVhLTMzYjY1ODkxM2E4YiJ9.JDu85hTysDmhD1WwNNXzJ0o8UtsPDH3ONnMAYXZPBxy2VhzhF51dDpPkPIRftSGO-dyZeQFCgWkU5Nj6gx1AoQ;/'|

File diff suppressed because it is too large Load Diff

View File

@ -26,24 +26,27 @@ public class ReadLoginInfo : MonoBehaviour
if (File.Exists(path)) if (File.Exists(path))
{ {
str = File.ReadAllText(path); str = File.ReadAllText(path);
string[] data = str.Split(new char[] { '#' }); string[] data = str.Split(new char[] { ';' });
DateTime dateTime = DateTime.Parse(data[0]); //DateTime dateTime = DateTime.Parse(data[0]);
TimeSpan timeSpan = DateTime.Now - dateTime; //TimeSpan timeSpan = DateTime.Now - dateTime;
//if (dateTime.Second > 60) //if (dateTime.Second > 60)
//{ //{
// Debug.Log("请求超时"); // Debug.Log("请求超时");
//} //}
//else //else
//{ //{
string[] data2 = data[1].Split(new char[] { ';' }); string[] data2 = data[1].Split(new char[] { ',' });
Debug.Log(data2[1]); Debug.Log(data2[0]);
if (data2[1]=="0") if (data2[0]=="0")
{ {
PlayerPrefs.SetString("Name", data2[3]);
mainselect.practicebutton.onClick.Invoke(); mainselect.practicebutton.onClick.Invoke();
Debug.Log("进入了"); Debug.Log("进入了");
} }
else if (data2[1]=="1") else if (data2[0]=="1")
{ {
Debug.Log(data2[3]);
PlayerPrefs.SetString ("Name", data2[3]);
mainselect.examinationbutton.onClick.Invoke(); mainselect.examinationbutton.onClick.Invoke();
Debug.Log("跳转"); Debug.Log("跳转");
} }

View File

@ -1,5 +1,7 @@
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data;
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
using Unity.VisualScripting; using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
@ -79,7 +81,7 @@ public class Submit : MonoBehaviour
/// <summary> /// <summary>
/// 倒计时 /// 倒计时
/// </summary> /// </summary>
public Text timetext; public Text timetext;
/// <summary> /// <summary>
/// 提示是否交卷页面 /// 提示是否交卷页面
/// </summary> /// </summary>
@ -100,15 +102,37 @@ public class Submit : MonoBehaviour
/// 三个菜单按钮 /// 三个菜单按钮
/// </summary> /// </summary>
public GameObject electricitychargeaccounting, powersupplycontract; public GameObject electricitychargeaccounting, powersupplycontract;
/// <summary>
/// 初始化用户名
/// </summary>
public Text nametext;
/// <summary>
/// 操作步骤信息
/// </summary>
public GameObject firstcontent, secondcontent, thirdcontent, numberfourcontent, fifthcontent, sixthcontent, seventhcontent, eighthcontent;
/// <summary>
/// 初始化时间
/// </summary>
public Text loginname;
private void Awake() private void Awake()
{ {
loginname.text = DateTime.Now.ToString();
nametext.text = PlayerPrefs.GetString("Name");
Debug.Log(nametext.text);
Debug.LogError(ScoreManager.Instance.judgmentbos); Debug.LogError(ScoreManager.Instance.judgmentbos);
practicesprite = Resources.Load<Sprite>("UIpanel/练习模式"); practicesprite = Resources.Load<Sprite>("UIpanel/练习模式");
examinesprite = Resources.Load<Sprite>("UIpanel/考试模式"); examinesprite = Resources.Load<Sprite>("UIpanel/考试模式");
contract.isOn = true; contract.isOn = true;
if (ScoreManager.Instance.judgmentbos) if (ScoreManager.Instance.judgmentbos)
{ {
firstcontent.SetActive(false);
secondcontent.SetActive(false);
thirdcontent.SetActive(false);
numberfourcontent.SetActive(false);
fifthcontent.SetActive(false);
sixthcontent.SetActive(false);
seventhcontent.SetActive(false);
eighthcontent.SetActive(false);
practicemode.sprite = examinesprite; practicemode.sprite = examinesprite;
electricitychargeaccounting.SetActive(false); electricitychargeaccounting.SetActive(false);
powersupplycontract.SetActive(false); powersupplycontract.SetActive(false);
@ -178,10 +202,10 @@ public class Submit : MonoBehaviour
{ {
coolingimage.fillAmount = 1 - (skilltimer / examinetimer); coolingimage.fillAmount = 1 - (skilltimer / examinetimer);
skilltimer += Time.deltaTime; skilltimer += Time.deltaTime;
timer-= Time.deltaTime; timer -= Time.deltaTime;
warntext.text = timer.ToString("0")+"秒后自动退出系统"; warntext.text = timer.ToString("0") + "秒后自动退出系统";
timetext.text = timer.ToString("0"); timetext.text = timer.ToString("0");
if (coolingimage.fillAmount==0) if (coolingimage.fillAmount == 0)
{ {
// 退出应用程序 // 退出应用程序
#if UNITY_EDITOR #if UNITY_EDITOR

View File

@ -254,6 +254,10 @@ public class Thethirdsteppanl : MonoBehaviour
{ {
ToggleValueChanged(togglepromise); ToggleValueChanged(togglepromise);
}); });
notoggle.onValueChanged.AddListener(delegate
{
ToggleValueChanged2(notoggle);
});
messagebutton.onClick.AddListener(() => messagebutton.onClick.AddListener(() =>
{ {
thirdoperationpanl5.gameObject.SetActive(false); thirdoperationpanl5.gameObject.SetActive(false);
@ -266,7 +270,6 @@ public class Thethirdsteppanl : MonoBehaviour
}); });
tapbutton.onClick.AddListener(() => tapbutton.onClick.AddListener(() =>
{ {
ScoreManager.Instance.AddScore(2);
thirdoperationpanl7.gameObject.SetActive(false); thirdoperationpanl7.gameObject.SetActive(false);
thirdoperationpanl8.gameObject.SetActive(true); thirdoperationpanl8.gameObject.SetActive(true);
}); });
@ -307,7 +310,7 @@ public class Thethirdsteppanl : MonoBehaviour
if (glideinput1.options[glideinput1.value].text == "否" && glideinput2.options[glideinput2.value].text == "否" && glideinput2.options[glideinput2.value].text == "否" if (glideinput1.options[glideinput1.value].text == "否" && glideinput2.options[glideinput2.value].text == "否" && glideinput2.options[glideinput2.value].text == "否"
&& glideinput2.options[glideinput2.value].text == "否" && cancelisp) && glideinput2.options[glideinput2.value].text == "否" && cancelisp)
{ {
ScoreManager.Instance.AddScore(3); ScoreManager.Instance.AddScore(4);
Debug.LogError(ScoreManager.Instance.Score); Debug.LogError(ScoreManager.Instance.Score);
cancelisp = false; cancelisp = false;
} }
@ -347,13 +350,13 @@ public class Thethirdsteppanl : MonoBehaviour
{ {
if (ison) if (ison)
{ {
ScoreManager.Instance.AddScore(2); ScoreManager.Instance.AddScore(3);
thirdoperationpanl9.gameObject.SetActive(false); thirdoperationpanl9.gameObject.SetActive(false);
thirdoperationpanl10.gameObject.SetActive(true); thirdoperationpanl10.gameObject.SetActive(true);
} }
else else
{ {
ScoreManager.Instance.SubtractScore(2); ScoreManager.Instance.SubtractScore(3);
} }
}); });
electricitytoggle2.onValueChanged.AddListener((ison) => electricitytoggle2.onValueChanged.AddListener((ison) =>
@ -472,6 +475,19 @@ public class Thethirdsteppanl : MonoBehaviour
thirdoperationpanl5.gameObject.SetActive(false); thirdoperationpanl5.gameObject.SetActive(false);
} }
} }
public void ToggleValueChanged2(Toggle toggle)
{
if (toggle.isOn)
{
thirdoperationpanl4.gameObject.SetActive(false);
thirdoperationpanl5.gameObject.SetActive(true);
}
else
{
thirdoperationpanl4.gameObject.SetActive(true);
thirdoperationpanl5.gameObject.SetActive(false);
}
}
/// <summary> /// <summary>
/// 用枚举判断选择了那个选项框 /// 用枚举判断选择了那个选项框
/// </summary> /// </summary>