You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.4 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XWFramework.UI;
using DG.Tweening;
using UnityEngine.UI;
namespace Level1 {
public class SafePanel : UIPanel
{
public GameObject select;
public GameObject dragAni;
public float speed = 1;
public Transform movePos;
protected override void Awake()
{
type = UIType.Safe;
base.Awake();
select.transform.GetChild(0).GetComponent<Button>().onClick.AddListener(()=> { GameManager.Instance.Transfer(); gameObject.SetActive(false); });
select.transform.GetChild(1).GetComponent<Button>().onClick.AddListener(()=> {
GameManager.Instance.ui.ShowErrorTip("操作错误,请重试");
});
}
protected override void Init()
{
//GameManager.Instance.ui.ShowTip(GameManager.Instance.dataManager.dialogues[1]);
select.GetComponent<RectTransform>().DOMove(movePos.position, 2);
}
private void Update()
{
if (Input.GetMouseButton(0))
{
if (Input.GetAxis("Mouse X") != 0)
{
dragAni.SetActive(false);
}
GameManager.Instance.cameraManager.cm.m_XAxis.Value += Input.GetAxis("Mouse X") * speed;
}
}
}
}