245 lines
6.0 KiB
C#
245 lines
6.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
using UnityEngine.Device;
|
|
using UnityEngine.SocialPlatforms.Impl;
|
|
using UnityEngine.UI;
|
|
|
|
public class Thefifthstep : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 初始化第五步操作
|
|
/// </summary>
|
|
public RectTransform thefifthsteppanl;
|
|
/// <summary>
|
|
/// 页面1
|
|
/// </summary>
|
|
public RectTransform thefifthsteppanl1;
|
|
/// <summary>
|
|
/// 第五步页面工单编号
|
|
/// </summary>
|
|
public InputField inputid5;
|
|
/// <summary>
|
|
/// 待办按钮
|
|
/// </summary>
|
|
public Button waittobedonebutton;
|
|
/// <summary>
|
|
/// 待办工单
|
|
/// </summary>
|
|
public Button Backtodo;
|
|
/// <summary>
|
|
/// 页面2
|
|
/// </summary>
|
|
public RectTransform thefifthsteppanl2;
|
|
/// <summary>
|
|
/// 输入工单编号输入框
|
|
/// </summary>
|
|
public InputField inputfid5;
|
|
/// <summary>
|
|
/// 查询工单按钮
|
|
/// </summary>
|
|
public Button viewbutton5;
|
|
/// <summary>
|
|
/// 页面3
|
|
/// </summary>
|
|
public RectTransform thefifthsteppanl3;
|
|
/// <summary>
|
|
/// 勾选高亮选择
|
|
/// </summary>
|
|
public Toggle serialtoggle;
|
|
/// <summary>
|
|
/// 高量图片选择
|
|
/// </summary>
|
|
public Image serial5;
|
|
/// <summary>
|
|
/// 合同违约按钮
|
|
/// </summary>
|
|
public Button contractbutton;
|
|
/// <summary>
|
|
/// 签收按钮
|
|
/// </summary>
|
|
public Button signforbutton5;
|
|
/// <summary>
|
|
/// 签收保证得分只得一次
|
|
/// </summary>
|
|
private bool singsisp = false;
|
|
/// <summary>
|
|
/// 签收成功图片
|
|
/// </summary>
|
|
public Text Signfortext;
|
|
/// <summary>
|
|
/// 页面4
|
|
/// </summary>
|
|
public RectTransform thefifthsteppanl4;
|
|
/// <summary>
|
|
/// 高亮选项
|
|
/// </summary>
|
|
public Toggle examinetoggle5, examinetoggle6;
|
|
/// <summary>
|
|
/// 确认按钮
|
|
/// </summary>
|
|
public Button sendbutton55;
|
|
|
|
void Start()
|
|
{
|
|
waittobedonebutton.onClick.AddListener(() =>
|
|
{
|
|
|
|
thefifthsteppanl1.gameObject.SetActive(false);
|
|
thefifthsteppanl2.gameObject.SetActive(true);
|
|
});
|
|
Backtodo.onClick.AddListener(() =>
|
|
{
|
|
thefifthsteppanl1.gameObject.SetActive(false);
|
|
thefifthsteppanl2.gameObject.SetActive(true);
|
|
});
|
|
viewbutton5.onClick.AddListener(() =>
|
|
{
|
|
thefifthsteppanl2.gameObject.SetActive(false);
|
|
thefifthsteppanl3.gameObject.SetActive(true);
|
|
});
|
|
serialtoggle.onValueChanged.AddListener(delegate
|
|
{
|
|
Getreveal(serialtoggle);
|
|
});
|
|
contractbutton.onClick.AddListener(() =>
|
|
{
|
|
thefifthsteppanl3.gameObject.SetActive(false);
|
|
thefifthsteppanl4.gameObject.SetActive(true);
|
|
|
|
});
|
|
signforbutton5.onClick.AddListener(() =>
|
|
{
|
|
singsisp = true;
|
|
Signfortext.text = "签收成功";
|
|
_= Signfordata(Signfortext);
|
|
});
|
|
sendbutton55.onClick.AddListener(() =>
|
|
{
|
|
Debug.Log("第五步得分");
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Electricchargeexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Aluminoelectricexercise)
|
|
{
|
|
Practicescore5();
|
|
}
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexamination)
|
|
{
|
|
Judgmentstep5();
|
|
}
|
|
thefifthsteppanl4.gameObject.SetActive(false);
|
|
});
|
|
examinetoggle5.onValueChanged.AddListener((ison) =>
|
|
{
|
|
if (ison)
|
|
{
|
|
|
|
}
|
|
});
|
|
examinetoggle6.onValueChanged.AddListener((ison) =>
|
|
{
|
|
if (ison)
|
|
{
|
|
ScoreManager.Instance.SubtractScore(9);
|
|
Debug.Log("一开始不执行操作");
|
|
}
|
|
});
|
|
}
|
|
public async Task<Text> Signfordata(Text text)
|
|
{
|
|
await Task.Delay(1500);
|
|
text.text = null;
|
|
return text;
|
|
}
|
|
/// <summary>
|
|
/// 练习步骤得分
|
|
/// </summary>
|
|
private void Practicescore5()
|
|
{
|
|
if (serialtoggle.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(2.5f);//是否勾选
|
|
}
|
|
if (singsisp)
|
|
{
|
|
ScoreManager.Instance.AddScore(2.5f);//签收
|
|
}
|
|
if (examinetoggle5.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(7.5f);//是否通过
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 考试步骤得分
|
|
/// </summary>
|
|
private void Judgmentstep5()
|
|
{
|
|
float scroe = 0f;
|
|
string str;
|
|
if (serialtoggle.isOn)
|
|
{
|
|
scroe += (float.Parse(ScoreManager.Instance.totalpoints[4]) * 0.2f);
|
|
}
|
|
if (singsisp)
|
|
{
|
|
scroe += (float.Parse(ScoreManager.Instance.totalpoints[4]) * 0.2f);
|
|
}
|
|
if (examinetoggle5.isOn)
|
|
{
|
|
scroe += (float.Parse(ScoreManager.Instance.totalpoints[4]) * 0.6f);
|
|
}
|
|
if ((scroe - Mathf.Floor(scroe)) < 0.001f)
|
|
{
|
|
str = scroe.ToString();
|
|
}
|
|
else
|
|
{
|
|
str = scroe.ToString("f2");
|
|
}
|
|
ScoreManager.Instance.Honourscores[4] = float.Parse(str);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 图片显示高亮
|
|
/// </summary>
|
|
/// <param name="toggle"></param>
|
|
private void Getreveal(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
|
|
serial5.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
|
|
serial5.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化第五步界面
|
|
/// </summary>
|
|
public void Getscreen()
|
|
{
|
|
thefifthsteppanl.gameObject.SetActive(true);
|
|
}
|
|
/// <summary>
|
|
/// 初始化得分步骤
|
|
/// </summary>
|
|
public void Getrestore5()
|
|
{
|
|
inputfid5.text = null;
|
|
serialtoggle.isOn = false;
|
|
serial5.gameObject.SetActive(false);
|
|
examinetoggle5.isOn = false;
|
|
examinetoggle6.isOn = false;
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|