216 lines
5.1 KiB
C#
216 lines
5.1 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Stepsixpanl : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 初始化页面
|
|
/// </summary>
|
|
public RectTransform stepsixpanl;
|
|
/// <summary>
|
|
/// 页面1
|
|
/// </summary>
|
|
public RectTransform stepsixpanl1;
|
|
/// <summary>
|
|
/// 待办按钮
|
|
/// </summary>
|
|
public Button waittobebutton6;
|
|
/// <summary>
|
|
/// 页面2
|
|
/// </summary>
|
|
public RectTransform stepsixpanl2;
|
|
/// <summary>
|
|
/// 输入编号
|
|
/// </summary>
|
|
public InputField inputfid6;
|
|
/// <summary>
|
|
/// 查询按钮
|
|
/// </summary>
|
|
public Button inquirebutton6;
|
|
/// <summary>
|
|
/// 高亮选择
|
|
/// </summary>
|
|
public Toggle serialtoggle6;
|
|
/// <summary>
|
|
/// 图片选择
|
|
/// </summary>
|
|
public Image serialimage6;
|
|
/// <summary>
|
|
/// 合同违约审批按钮
|
|
/// </summary>
|
|
public Button examinebutton6;
|
|
/// <summary>
|
|
/// 页面3
|
|
/// </summary>
|
|
public RectTransform stepsixpanl3;
|
|
/// <summary>
|
|
/// 确认签收按钮
|
|
/// </summary>
|
|
public Button yesbutton;
|
|
/// <summary>
|
|
/// 确认按钮开关
|
|
/// </summary>
|
|
private bool yesisp = false;
|
|
/// <summary>
|
|
/// 取消签收按钮
|
|
/// </summary>
|
|
public Button nobutton;
|
|
/// <summary>
|
|
/// 页面4
|
|
/// </summary>
|
|
public RectTransform stepsixpanl4;
|
|
/// <summary>
|
|
/// 选择通过
|
|
/// </summary>
|
|
public Toggle passtoggle6;
|
|
/// <summary>
|
|
/// 选择不通过
|
|
/// </summary>
|
|
public Toggle nopasstoggle6;
|
|
/// <summary>
|
|
/// 发送按钮
|
|
/// </summary>
|
|
public Button sendbutton6;
|
|
|
|
void Start()
|
|
{
|
|
waittobebutton6.onClick.AddListener(() =>
|
|
{
|
|
|
|
stepsixpanl1.gameObject.SetActive(false);
|
|
stepsixpanl2.gameObject.SetActive(true);
|
|
});
|
|
serialtoggle6.onValueChanged.AddListener(delegate
|
|
{
|
|
Gettoggle(serialtoggle6);
|
|
});
|
|
examinebutton6.onClick.AddListener(() =>
|
|
{
|
|
stepsixpanl2.gameObject.SetActive(false);
|
|
stepsixpanl3.gameObject.SetActive(true);
|
|
});
|
|
yesbutton.onClick.AddListener(() =>
|
|
{
|
|
yesisp = true;
|
|
stepsixpanl3.gameObject.SetActive(false);
|
|
stepsixpanl4.gameObject.SetActive(true);
|
|
});
|
|
nobutton.onClick.AddListener(() =>
|
|
{
|
|
stepsixpanl3.gameObject.SetActive(false);
|
|
stepsixpanl4.gameObject.SetActive(true);
|
|
});
|
|
sendbutton6.onClick.AddListener(() =>
|
|
{
|
|
Debug.Log("第六步得分");
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Electricchargeexercise ||
|
|
ScoreManager.Instance.Subject == Subject.Aluminoelectricexercise)
|
|
{
|
|
Practicescore6(); ;
|
|
}
|
|
if (ScoreManager.Instance.Subject == Subject.Performanceexamination)
|
|
{
|
|
Judgmentstep6();
|
|
}
|
|
stepsixpanl4.gameObject.SetActive(false);
|
|
});
|
|
passtoggle6.onValueChanged.AddListener((ison) =>
|
|
{
|
|
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 练习步骤得分
|
|
/// </summary>
|
|
private void Practicescore6()
|
|
{
|
|
if (serialtoggle6.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(2.5f);//是否勾选
|
|
|
|
}
|
|
if (yesisp)
|
|
{
|
|
ScoreManager.Instance.AddScore(2.5f);//签收
|
|
|
|
}
|
|
if (passtoggle6.isOn)
|
|
{
|
|
ScoreManager.Instance.AddScore(7.5f);//是否通过
|
|
|
|
}
|
|
}
|
|
|
|
private void Judgmentstep6()
|
|
{
|
|
float score = 0f;
|
|
string str;
|
|
if (serialtoggle6.isOn)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[5]) * 0.2f);
|
|
}
|
|
if (yesisp)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[5]) * 0.2f);
|
|
}
|
|
if (passtoggle6.isOn)
|
|
{
|
|
score += (float.Parse(ScoreManager.Instance.totalpoints[5]) * 0.6f);
|
|
}
|
|
if ((score - Mathf.Floor(score)) < 0.001f)
|
|
{
|
|
str = score.ToString();
|
|
}
|
|
else
|
|
{
|
|
str = score.ToString("0.000");
|
|
}
|
|
ScoreManager.Instance.Honourscores[5] = float.Parse(str);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 图片高亮
|
|
/// </summary>
|
|
/// <param name="toggle"></param>
|
|
private void Gettoggle(Toggle toggle)
|
|
{
|
|
if (toggle.isOn)
|
|
{
|
|
|
|
serialimage6.gameObject.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
|
|
serialimage6.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化页面
|
|
/// </summary>
|
|
public void Getpage()
|
|
{
|
|
stepsixpanl.gameObject.SetActive(true);
|
|
}
|
|
/// <summary>
|
|
/// 初始化得分步骤按钮
|
|
/// </summary>
|
|
public void Getrestore6()
|
|
{
|
|
inputfid6.text = null;
|
|
serialtoggle6.isOn = false;
|
|
serialimage6.gameObject.SetActive(false);
|
|
passtoggle6.isOn = false;
|
|
nopasstoggle6.isOn = false;
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|