using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Device;
using UnityEngine.UI;
public class Thefifthstep : MonoBehaviour
{
///
/// 初始化第五步操作
///
public RectTransform thefifthsteppanl;
///
/// 页面1
///
public RectTransform thefifthsteppanl1;
///
/// 第五步页面工单编号
///
public InputField inputid5;
///
/// 待办按钮
///
public Button waittobedonebutton;
///
/// 页面2
///
public RectTransform thefifthsteppanl2;
///
/// 输入工单编号输入框
///
public InputField inputfid5;
///
/// 查询工单按钮
///
public Button viewbutton5;
///
/// 页面3
///
public RectTransform thefifthsteppanl3;
///
/// 勾选高亮选择
///
public Toggle serialtoggle;
///
/// 高量图片选择
///
public Image serial5;
///
/// 合同违约按钮
///
public Button contractbutton;
///
/// 签收按钮
///
public Button signforbutton5;
///
/// 签收保证得分只得一次
///
private bool singsisp = false;
///
/// 签收成功图片
///
public Image signforimage5;
///
/// 页面4
///
public RectTransform thefifthsteppanl4;
///
/// 高亮选项
///
public Toggle examinetoggle5, examinetoggle6;
///
/// 确认按钮
///
public Button sendbutton55;
///
/// 第五步判断得分
///
private float thefifthstep1 = 0f;
private float thefifthstep2 = 0f;
private float thefifthstep3 = 0f;
void Start()
{
waittobedonebutton.onClick.AddListener(() =>
{
thefifthsteppanl1.gameObject.SetActive(false);
thefifthsteppanl2.gameObject.SetActive(true);
});
viewbutton5.onClick.AddListener(() =>
{
thefifthsteppanl2.gameObject.SetActive(false);
thefifthsteppanl3.gameObject.SetActive(true);
});
serialtoggle.onValueChanged.AddListener(delegate
{
Getreveal(serialtoggle);
});
contractbutton.onClick.AddListener(() =>
{
thefifthsteppanl3.gameObject.SetActive(false);
thefifthsteppanl4.gameObject.SetActive(true);
});
signforbutton5.onClick.AddListener(() =>
{
singsisp = true;
signforimage5.gameObject.SetActive(true);
Invoke("Getreveal2", 1.5f);
});
sendbutton55.onClick.AddListener(() =>
{
Debug.Log("第五步得分");
if (serialtoggle.isOn)
{
ScoreManager.Instance.AddScore(1.5f);//是否勾选
thefifthstep1 = ScoreManager.Instance.scores[4] * 0.2f;
}
if (singsisp)
{
ScoreManager.Instance.AddScore(2);//签收
thefifthstep2 = ScoreManager.Instance.scores[4] * 0.2f;
}
if (examinetoggle5.isOn)
{
ScoreManager.Instance.AddScore(9);//是否通过
thefifthstep3 = ScoreManager.Instance.scores[4] * 0.6f;
}
float value = thefifthstep1 + thefifthstep2 + thefifthstep3;
ScoreManager.Instance.totalpoints.Add(value);
Debug.Log(ScoreManager.Instance.Score);
thefifthsteppanl4.gameObject.SetActive(false);
});
examinetoggle5.onValueChanged.AddListener((ison) =>
{
if (ison)
{
}
});
examinetoggle6.onValueChanged.AddListener((ison) =>
{
if (ison)
{
ScoreManager.Instance.SubtractScore(9);
Debug.Log("一开始不执行操作");
}
});
}
///
/// 关闭签收成功按钮
///
private void Getreveal2()
{
signforimage5.gameObject.SetActive(false);
}
///
/// 图片显示高亮
///
///
private void Getreveal(Toggle toggle)
{
if (toggle.isOn)
{
serial5.gameObject.SetActive(true);
}
else
{
serial5.gameObject.SetActive(false);
}
}
///
/// 初始化第五步界面
///
public void Getscreen()
{
thefifthsteppanl.gameObject.SetActive(true);
}
///
/// 初始化得分步骤
///
public void Getrestore5()
{
inputfid5.text = null;
serialtoggle.isOn = false;
serial5.gameObject.SetActive(false);
examinetoggle5.isOn = false;
examinetoggle6.isOn = false;
}
void Update()
{
}
}