CultivationOfBrewing-2/Assets/Scripts/UI/UIPanel/UI_GraphicRextualPanel.cs

70 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class UI_GraphicRextualPanel : BasePanel
{
public RawImage rawImage;
//顶部文字
public TextMeshProUGUI ToptextMeshProUGUI;
//内容
public TextMeshProUGUI ContentTextMeshProUGUI;
public GameObject player;
public FirstPersonController controller;
protected override void Awake()
{
base.Awake();
player = GameObject.FindWithTag("Player");
if (player != null)
{
controller = player.GetComponent<FirstPersonController>();
if (controller != null)
{
controller.enabled = false;
}
else
{
Debug.LogError("FirstPersonController脚本未找到");
}
}
}
public override void ShowMe()
{
base.ShowMe();
LiveSceneManger.Instance.A.enabled = true;
LiveSceneManger.Instance.B.enabled = true;
}
public override void HideMe()
{
base.HideMe();
if (controller != null)
{
controller.enabled = true;
}
else
{
Debug.LogError("FirstPersonController脚本未找到");
}
}
protected override void OnClick(string btnName)
{
switch (btnName)
{
case "returnBtn":
Bootstrap.Instance.uiManager.HidePanel<UI_GraphicRextualPanel>();
LiveSceneManger.Instance.TipBtn.gameObject.SetActive(true);
LiveSceneManger.Instance.A.enabled = false;
LiveSceneManger.Instance.B.enabled = false;
break;
}
}
}