using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class Stepeightpanl : MonoBehaviour
{
///
/// 初始化页面
///
public RectTransform stepeightpanl;
///
/// 页面1
///
public RectTransform stepeightpanl1;
///
/// 复制编号
///
public InputField inputid8;
///
/// 待办工单按钮
///
public Button waittobedonebutton8;
///
/// 页面2
///
public RectTransform stepeightpanl2;
///
/// 输入工单编号
///
public InputField inputfid8;
///
/// 查询工单按钮
///
public Button inquirebutton8;
///
/// 页面3
///
public RectTransform stepeightpanl3;
///
/// 勾选高亮选择
///
public Toggle serialtoggle8;
///
/// 勾选图片
///
public Image serialimage8;
///
/// 合同违约归档按钮
///
public Button recyclebutton8;
///
/// 签收按钮
///
public Button signforbutton8;
///
/// 签收按钮开关
///
private bool signforisp = false;
///
/// 合同签收成功图片
///
public Image signforimage8;
///
/// 页面4
///
public RectTransform stepeightpanl4;
///
/// 归档按钮
///
public Button archivistbutton;
///
/// 提示页面
///
public Whetherthandinpapersornot whetherthandinpapersornot;
///
/// 归档按钮判断
///
private bool archivsisp=true;
void Start()
{
waittobedonebutton8.onClick.AddListener(() =>
{
archivsisp = true;
stepeightpanl1.gameObject.SetActive(false);
stepeightpanl2.gameObject.SetActive(true);
});
inquirebutton8.onClick.AddListener(() =>
{
stepeightpanl2.gameObject.SetActive(false);
stepeightpanl3.gameObject.SetActive(true);
});
serialtoggle8.onValueChanged.AddListener(delegate
{
Getpicture(serialtoggle8);
});
recyclebutton8.onClick.AddListener(() =>
{
stepeightpanl3.gameObject.SetActive(false);
stepeightpanl4.gameObject.SetActive(true);
});
signforbutton8.onClick.AddListener(() =>
{
signforisp = true;
signforimage8.gameObject.SetActive(true);
Invoke("Getpicture2", 1.5f);
});
archivistbutton.onClick.AddListener(() =>
{
if (archivsisp)
{
Debug.Log("第八步判分");
if (ScoreManager.Instance.Subject == Subject.Performanceexercise ||
ScoreManager.Instance.Subject == Subject.Electricchargeexercise ||
ScoreManager.Instance.Subject == Subject.Aluminoelectricexercise)
{
Practicescore8();
}
if (ScoreManager.Instance.Subject == Subject.Performanceexamination)
{
Judgmentstep8();
}
Debug.Log(ScoreManager.Instance.Score);
archivsisp = false;
}
if (ScoreManager.Instance.Subject==Subject.Performanceexamination)
{
whetherthandinpapersornot.gameObject.SetActive(true);
}
});
Tipspanl();
}
///
/// 练习步骤得分
///
private void Practicescore8()
{
if (serialtoggle8.isOn)
{
ScoreManager.Instance.AddScore(2.5f);//是否勾选
}
if (signforisp)
{
ScoreManager.Instance.AddScore(2.5f);//签收
}
ScoreManager.Instance.AddScore(7.5f);
}
///
/// 考试步骤得分
///
private void Judgmentstep8()
{
float score = 0f;
string str;
if (serialtoggle8.isOn)
{
score += (float.Parse(ScoreManager.Instance.totalpoints[7]) * 0.2f);
}
if (signforisp)
{
score += (float.Parse(ScoreManager.Instance.totalpoints[7]) * 0.2f);
}
score += (float.Parse(ScoreManager.Instance.totalpoints[7]) * 0.6f);
if ((score - Mathf.Floor(score)) < 0.001f)
{
str = score.ToString();
}
else
{
str = score.ToString("f2");
}
ScoreManager.Instance.Honourscores[7] = float.Parse(str);
}
///
/// 提示是否交卷页面
///
private void Tipspanl()
{
whetherthandinpapersornot.Cancel(() =>
{
whetherthandinpapersornot.gameObject.SetActive(false);
});
whetherthandinpapersornot.Submitbon(() =>
{
if (ScoreManager.Instance.Subject==Subject.Performanceexamination)
{
Submit game1 = GameObject.Find("MianCanvas").GetComponent();
game1.Handinanexaminationpaper1();
}
});
}
public void Getpicture2()
{
signforimage8.gameObject.SetActive(false);
}
///
/// 显示图片
///
///
public void Getpicture(Toggle toggle)
{
if (toggle.isOn)
{
serialimage8.gameObject.SetActive(true);
}
else
{
serialimage8.gameObject.SetActive(false);
}
}
///
/// 初始化页面方法
///
public void Getpage8()
{
stepeightpanl.gameObject.SetActive(true);
}
///
/// 得分初始化步骤
///
public void Getrestore8()
{
inputfid8.text = null;
serialtoggle8.isOn = false;
serialimage8.gameObject.SetActive(false);
}
void Update()
{
}
}