163 lines
3.8 KiB
C#
163 lines
3.8 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Operationprocess : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 违约类型操作页面
|
|
/// </summary>
|
|
public RectTransform operationpanel;
|
|
/// <summary>
|
|
/// 违约类型
|
|
/// </summary>
|
|
public Dropdown typeofbreach;
|
|
/// <summary>
|
|
/// 接收违约类型下拉框
|
|
/// </summary>
|
|
public string strtext;
|
|
/// <summary>
|
|
/// 接收违约现场地址和显示文本
|
|
/// </summary>
|
|
public InputField fieldaddress, reportinformation;
|
|
/// <summary>
|
|
/// 上报按钮
|
|
/// </summary>
|
|
public Button report;
|
|
/// <summary>
|
|
/// 空页面
|
|
/// </summary>
|
|
public GameObject thesecondsteppanl;
|
|
/// <summary>
|
|
/// 工单编号页面
|
|
/// </summary>
|
|
public RectTransform workordernumber;
|
|
/// <summary>
|
|
/// 操作完成颜色变深
|
|
/// </summary>
|
|
private Sprite procedure;
|
|
/// <summary>
|
|
/// 操作步骤颜色变深
|
|
/// </summary>
|
|
public List<Image> chartletlist = new List<Image>();
|
|
/// <summary>
|
|
/// 签收页面
|
|
/// </summary>
|
|
public Signforpanl signforpanl;
|
|
/// <summary>
|
|
/// 第三步签收步骤面板
|
|
/// </summary>
|
|
public Thethirdsteppanl thethirdsteppanl;
|
|
|
|
private void Awake()
|
|
{
|
|
Init();
|
|
}
|
|
|
|
private void Init()
|
|
{
|
|
procedure = Resources.Load<Sprite>("UIpanel/procedure");
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
typeofbreach.onValueChanged.AddListener(delegate
|
|
{
|
|
OnDropdownValueChanged(typeofbreach);
|
|
});
|
|
report.onClick.AddListener(Reportoperation);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 判断违约类型方法
|
|
/// </summary>
|
|
private void Reportoperation()
|
|
{
|
|
Debug.Log("第一步骤得分");
|
|
|
|
if (typeofbreach.options[typeofbreach.value].text.Length > 1)
|
|
{
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexercise||
|
|
ScoreManager.Instance.Subject == Subject.Electricchargeexercise||
|
|
ScoreManager.Instance.Subject == Subject.Aluminoelectricexercise)
|
|
{
|
|
Practicescore1();
|
|
}
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexamination)
|
|
{
|
|
Judgmentstep1();
|
|
}
|
|
operationpanel.gameObject.SetActive(false);
|
|
thesecondsteppanl.SetActive(true);
|
|
workordernumber.gameObject.SetActive(true);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
/// <summary>
|
|
/// 练习步骤分
|
|
/// </summary>
|
|
private void Practicescore1()
|
|
{
|
|
ScoreManager.Instance.AddScore(12.5f);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 考试步骤分
|
|
/// </summary>
|
|
private void Judgmentstep1()
|
|
{
|
|
if (typeofbreach.options[typeofbreach.value].text == "窃电")
|
|
{
|
|
ScoreManager.Instance.Honourscores[0] = float.Parse(ScoreManager.Instance.totalpoints[0]);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 完成每一步替换图片方法
|
|
/// </summary>
|
|
public void Picturesubstitution(int value)
|
|
{
|
|
chartletlist[value].sprite = procedure;
|
|
}
|
|
/// <summary>
|
|
/// 参数传递
|
|
/// </summary>
|
|
public void Transmit()
|
|
{
|
|
thethirdsteppanl.Getvalue(strtext, fieldaddress.text, reportinformation.text);
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// 复制选项框中的内容
|
|
/// </summary>
|
|
/// <param name="dropdown"></param>
|
|
public void OnDropdownValueChanged(Dropdown dropdown)
|
|
{
|
|
strtext = dropdown.options[dropdown.value].text;
|
|
if (dropdown.options[dropdown.value].text != "窃电")
|
|
{
|
|
Debug.Log("进来了");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 把图片变色还原
|
|
/// </summary>
|
|
public void Getinitialize()
|
|
{
|
|
for (int i = 0; i < chartletlist.Count; i++)
|
|
{
|
|
chartletlist[i].sprite = null;
|
|
}
|
|
}
|
|
|
|
}
|