E_ElecCompetition/Electrical_inspectionCompet.../Assets/Adam/Scripts/AssignmentController.cs

62 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using AData;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//============================================================
//支持中文文件使用UTF-8编码
//@author YangHua
//@create 20230913
//@company Adam
//
//@description:
//============================================================
namespace Adam
{
public class AssignmentController : MonoBehaviour
{
public GameObject RWPanel;
public RectTransform rws;
public Text rwsTip;
public Button loadBtn;
public Button closeBtn;
public Vector2 originPos = new Vector2();
public string url = "http://111.229.30.246:10013/Handler/Taiqu.ashx?action=rws";
private async void Awake()
{
AssignmentDatas aData = await AsyncWebReq.Get<AssignmentDatas>(url);
rwsTip.text = aData.message;
}
private void Start()
{
originPos = rws.anchoredPosition;
loadBtn.onClick.AddListener(OnLoad);
closeBtn.onClick.AddListener(() => { SwitchPanel(false); });
SwitchPanel(false);
}
public void SwitchPanel(bool isActive)
{
RWPanel.SetActive(isActive);
}
public void ChangeRWPanelPos()
{
rws.anchoredPosition = originPos;
}
public void OnLoad()
{
UIManager.Instance.bottomCotroller.SwitchPanel(true);
UIManager.Instance.exitBtn.gameObject.SetActive(true);
rws.anchoredPosition = Vector2.zero;
loadBtn.gameObject.SetActive(false);
closeBtn.gameObject.SetActive(true);
SwitchPanel(false);
SceneLoad.Instance.SceneChange("工具间场景");
}
}
}