62 lines
1.8 KiB
C#
62 lines
1.8 KiB
C#
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("工具间场景");
|
||
|
||
}
|
||
}
|
||
}
|