130 lines
4.1 KiB
C#
130 lines
4.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class AssignmentPanel :MonoBehaviour
|
|
{
|
|
bool show = false;
|
|
public Text backgroundInformation;
|
|
public Text workOrderContent;
|
|
public Text GZTime;
|
|
public Text CuiZu;
|
|
public Text CLTime;
|
|
public Text loginText;
|
|
public Text GZTime2;
|
|
public Text loginText2;
|
|
public Text TQtext;
|
|
public Text XLtext;
|
|
public Button BackBtn;
|
|
public Button QUButton;
|
|
public Button magBtn;
|
|
public Image RWText;
|
|
public Image bg;
|
|
public Image bg2;
|
|
public Image RWText22;
|
|
public Button RWButton;
|
|
public Button TQButton;
|
|
public Text RWText2;
|
|
public RectTransform TQbgtext;
|
|
public Button closeButton;
|
|
|
|
|
|
public string sceneName;
|
|
void Start()
|
|
{
|
|
magBtn.onClick.AddListener(() => {
|
|
// GameObject.FindObjectOfType<ShouJ>().isk = true;
|
|
// bg.gameObject.SetActive(false);
|
|
// bg2.gameObject.SetActive(true);
|
|
// bg2.GetComponent<RectTransform>().DOLocalMove(new Vector3(545, 2, 0), 2);
|
|
RWText.gameObject.SetActive(true);
|
|
});
|
|
QUButton.onClick.AddListener(() => {
|
|
Debug.Log(sceneName);
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName);
|
|
});
|
|
}
|
|
public void WinDoScale()
|
|
{
|
|
//设置更改窗口的大小
|
|
Vector3 max = new Vector3(0.45f, 0.45f, 0.45f);
|
|
//设置变化时间
|
|
float time = 2f;
|
|
// bg.GetComponent<RectTransform>().DOScale(max, time);
|
|
// bg.GetComponent<RectTransform>().DOLocalMove(new Vector3(37, -12, 0), time);
|
|
}
|
|
//void BackClick()
|
|
//{
|
|
//BackBtn.onClick.AddListener(() => { ClosePanel<AssignmentPanel>(); });
|
|
//}
|
|
void magClick()
|
|
{
|
|
|
|
}
|
|
//void RWClick()
|
|
//{
|
|
// RWButton.onClick.AddListener(() => {
|
|
// workOrderContent.gameObject.SetActive(true);
|
|
// TQbgtext.gameObject.SetActive(false);
|
|
// RWButton.GetComponent<Image>().sprite = Resources.Load<Sprite>("UI/AssignmentPanel/Texture/Btns/任务书-点击状态-2");
|
|
// TQButton.GetComponent<Image>().sprite = Resources.Load<Sprite>("UI/AssignmentPanel/Texture/Btns/背景资料-未点击状态");
|
|
// });
|
|
//}
|
|
//void TQBGClick()
|
|
//{
|
|
// TQButton.onClick.AddListener(() => { workOrderContent.gameObject.SetActive(false); TQbgtext.gameObject.SetActive(true); RWText22.gameObject.SetActive(true);
|
|
// RWButton.GetComponent<Image>().sprite = Resources.Load<Sprite>("UI/AssignmentPanel/Texture/Btns/任务书-未点击状态");
|
|
// TQButton.GetComponent<Image>().sprite = Resources.Load<Sprite>("UI/AssignmentPanel/Texture/Btns/背景资料-点击状态-2");
|
|
// });
|
|
//}
|
|
////public override void Active()
|
|
//{
|
|
// base.Active();
|
|
// if (show&&isActive())
|
|
// {
|
|
// Hide();
|
|
// return;
|
|
// }
|
|
// show = true;
|
|
// if (Data != null)
|
|
// {
|
|
// if ((int)Data == 1)
|
|
// {
|
|
// RWText22.gameObject.SetActive(true);
|
|
// bg.gameObject.SetActive(false);
|
|
// RWText.gameObject.SetActive(false);
|
|
// }
|
|
// }
|
|
// else
|
|
// {
|
|
|
|
// }
|
|
|
|
|
|
//if (transform.GetChild(0).gameObject.activeInHierarchy)
|
|
//{
|
|
// transform.GetChild(0).gameObject.SetActive(false);
|
|
//}
|
|
//else
|
|
//{
|
|
// transform.GetChild(0).gameObject.SetActive(true);
|
|
//}
|
|
// }
|
|
//public override void Hide()
|
|
//{
|
|
// base.Hide();
|
|
// show = false;
|
|
//}
|
|
//void assignmentRead()
|
|
//{
|
|
// for (int i = 0; i < ReadJson.Instance.r2.examJsons.Count; i++)
|
|
// {
|
|
// GZTime.text = ReadJson.Instance.r2.examJsons[i].GZTime;
|
|
// GZTime2.text = ReadJson.Instance.r2.examJsons[i].GZTime;
|
|
// CuiZu.text = ReadJson.Instance.r2.examJsons[i].CuiZu;
|
|
// CLTime.text = ReadJson.Instance.r2.examJsons[i].CLTime;
|
|
// TQtext.text = ReadJson.Instance.r2.examJsons[i].PlatformArea;
|
|
// XLtext.text = ReadJson.Instance.r2.examJsons[i].line;
|
|
// }
|
|
//}
|
|
}
|