ShanxiKnowledgeBase/SXElectricity Marketing 2.0/Assets/Zion/Scripts/YL/Stepeightpanl.cs

242 lines
6.1 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
public class Stepeightpanl : MonoBehaviour
{
/// <summary>
/// 놓迦뺏女충
/// </summary>
public RectTransform stepeightpanl;
/// <summary>
/// 女충1
/// </summary>
public RectTransform stepeightpanl1;
/// <summary>
/// 릿齡긍뵀
/// </summary>
public InputField inputid8;
/// <summary>
/// 덤곗묏데객큐
/// </summary>
public Button waittobedonebutton8;
/// <summary>
/// 女충2
/// </summary>
public RectTransform stepeightpanl2;
/// <summary>
/// 渴흙묏데긍뵀
/// </summary>
public InputField inputfid8;
/// <summary>
/// 꿴璂묏데객큐
/// </summary>
public Button inquirebutton8;
/// <summary>
/// 女충3
/// </summary>
public RectTransform stepeightpanl3;
/// <summary>
/// 뭅朞멕좋朞嶝
/// </summary>
public Toggle serialtoggle8;
/// <summary>
/// 뭅朞暠튬
/// </summary>
public Image serialimage8;
/// <summary>
/// 북谿跨獨백도객큐
/// </summary>
public Button recyclebutton8;
/// <summary>
/// 푯澗객큐
/// </summary>
public Button signforbutton8;
/// <summary>
/// 푯澗객큐역밑
/// </summary>
private bool signforisp = false;
/// <summary>
/// 북谿푯澗냥묘暠튬
/// </summary>
public Image signforimage8;
/// <summary>
/// 女충4
/// </summary>
public RectTransform stepeightpanl4;
/// <summary>
/// 백도객큐
/// </summary>
public Button archivistbutton;
/// <summary>
/// 瓊刻女충
/// </summary>
public Whetherthandinpapersornot whetherthandinpapersornot;
/// <summary>
/// 백도객큐털뙤
/// </summary>
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();
}
/// <summary>
/// 족構꼍朧돤롸
/// </summary>
private void Practicescore8()
{
if (serialtoggle8.isOn)
{
ScoreManager.Instance.AddScore(2.5f);//角뤠뭅朞
}
if (signforisp)
{
ScoreManager.Instance.AddScore(2.5f);//푯澗
}
ScoreManager.Instance.AddScore(7.5f);
}
/// <summary>
/// 옘桿꼍朧돤롸
/// </summary>
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("0.000");
}
ScoreManager.Instance.Honourscores[7] = float.Parse(str);
}
/// <summary>
/// 瓊刻角뤠슥얩女충
/// </summary>
private void Tipspanl()
{
whetherthandinpapersornot.Cancel(() =>
{
whetherthandinpapersornot.gameObject.SetActive(false);
});
whetherthandinpapersornot.Submitbon(() =>
{
if (ScoreManager.Instance.Subject==Subject.Performanceexamination)
{
Submit game1 = GameObject.Find("MianCanvas").GetComponent<Submit>();
game1.Handinanexaminationpaper1();
}
});
}
public void Getpicture2()
{
signforimage8.gameObject.SetActive(false);
}
/// <summary>
/// 鞫刻暠튬
/// </summary>
/// <param name="toggle"></param>
public void Getpicture(Toggle toggle)
{
if (toggle.isOn)
{
serialimage8.gameObject.SetActive(true);
}
else
{
serialimage8.gameObject.SetActive(false);
}
}
/// <summary>
/// 놓迦뺏女충렘랬
/// </summary>
public void Getpage8()
{
stepeightpanl.gameObject.SetActive(true);
}
/// <summary>
/// 돤롸놓迦뺏꼍朧
/// </summary>
public void Getrestore8()
{
inputfid8.text = null;
serialtoggle8.isOn = false;
serialimage8.gameObject.SetActive(false);
}
void Update()
{
}
}