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 float firststep = 0f;
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 (typeofbreach.options[typeofbreach.value].text == "窃电")
{
ScoreManager.Instance.AddScore(12.5f);
firststep = ScoreManager.Instance.scores[0];
}
ScoreManager.Instance.totalpoints.Add(firststep);
operationpanel.gameObject.SetActive(false);
thesecondsteppanl.SetActive(true);
workordernumber.gameObject.SetActive(true);
}
}
///
/// 完成每一步替换图片方法
///
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;
}
///
/// 把图片变色还原
///
public void Getinitialize()
{
for (int i = 0; i < chartletlist.Count; i++)
{
chartletlist[i].sprite = null;
}
}
///
/// 还原页面的变化
///
public void Getrestore1()
{
typeofbreach.value = 3;
fieldaddress.text = null;
reportinformation.text = null;
}
}