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