61 lines
1.6 KiB
C#
61 lines
1.6 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class UI_ContentPanel : BasePanel
|
|
{
|
|
public Image ContentPanel;
|
|
|
|
public Button enter;
|
|
public Button exit;
|
|
public TextMeshProUGUI ContentText;
|
|
public RawImage ContentrawImage;
|
|
protected override void Awake()
|
|
{
|
|
//ContentPanel = GetControl<Image>("BG");
|
|
//enter = GetControl<Button>("³ö");
|
|
//exit = GetControl<Button>("½ø");
|
|
|
|
base.Awake();
|
|
}
|
|
public void init(TextMeshProUGUI textMeshProUGUI,Texture texture)
|
|
{
|
|
textMeshProUGUI.text = ContentText.text;
|
|
texture = ContentrawImage.texture;
|
|
}
|
|
public override void ShowMe()
|
|
{
|
|
base.ShowMe();
|
|
}
|
|
public override void HideMe()
|
|
{
|
|
base.HideMe();
|
|
}
|
|
protected override void OnClick(string btnName)
|
|
{
|
|
Debug.Log(btnName);
|
|
switch (btnName)
|
|
{
|
|
case "exit":
|
|
if (ContentPanel.rectTransform.localPosition.x == 940)
|
|
{
|
|
ContentPanel.rectTransform.DOLocalMoveX(1330, 1f);
|
|
enter.gameObject.SetActive(true);
|
|
exit.gameObject.SetActive(false);
|
|
}
|
|
break;
|
|
case "enter":
|
|
if (ContentPanel.rectTransform.localPosition.x == 1330)
|
|
{
|
|
ContentPanel.rectTransform.DOLocalMoveX(940,1f);
|
|
enter.gameObject.SetActive(false);
|
|
exit.gameObject.SetActive(true);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|