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.
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class InfoWnd : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[Header("组件")]
|
|
|
|
|
public Text titleText,infoText;
|
|
|
|
|
public Transform infoTrans;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ShowInfoWnd(string title, string info)
|
|
|
|
|
{
|
|
|
|
|
//播放窗口动画
|
|
|
|
|
MoveWnd(infoTrans, Const.右侧菜单进入前位置, Const.右侧菜单进入后位置, 1f);
|
|
|
|
|
|
|
|
|
|
//显示信息
|
|
|
|
|
titleText.text = title;
|
|
|
|
|
infoText.text = info;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public void CloseInfoWnd()
|
|
|
|
|
{
|
|
|
|
|
//播放隐藏动画
|
|
|
|
|
MoveWnd(infoTrans, infoTrans.GetComponent<RectTransform>().anchoredPosition, Const.右侧菜单进入前位置, 1f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void MoveWnd(Transform WndTrans, Vector3 EnterPos, Vector3 EndPos, float time)
|
|
|
|
|
{
|
|
|
|
|
WndTrans.GetComponent<RectTransform>().anchoredPosition = EnterPos;
|
|
|
|
|
|
|
|
|
|
WndTrans.GetComponent<RectTransform>().DOAnchorPos(EndPos, time);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|