Files
UltimateFishing2020/Assets/Scripts/Assembly-CSharp/GetDropSupportPanel.cs
2026-03-04 10:03:45 +08:00

65 lines
1.5 KiB
C#

using UnityEngine;
using UnityEngine.UI;
public class GetDropSupportPanel : MonoBehaviour
{
[SerializeField]
private Image mouseImage;
[SerializeField]
private Image[] padBtnImage;
[SerializeField]
private Text keyText;
[SerializeField]
private Text infoText;
[SerializeField]
private Text cancelText;
private void Start()
{
}
private void Update()
{
}
public void Set(int mouseBtnIndex = 0, string infoT = "", string cancelT = "")
{
padBtnImage[0].gameObject.SetActive(value: false);
padBtnImage[1].gameObject.SetActive(value: false);
mouseImage.gameObject.SetActive(value: false);
if (GameManager.Instance.controllerType == GameManager.ControllerType.GamePad)
{
if (mouseBtnIndex == 0)
{
keyText.text = LanguageManager.Instance.GetText("PAD_A_BUTON");
padBtnImage[0].gameObject.SetActive(value: true);
}
if (mouseBtnIndex == 1)
{
keyText.text = LanguageManager.Instance.GetText("PAD_B_BUTON");
padBtnImage[1].gameObject.SetActive(value: true);
}
}
else
{
mouseImage.gameObject.SetActive(value: true);
if (mouseBtnIndex == 0)
{
keyText.text = LanguageManager.Instance.GetText("LEFT_MOUSE_BUTON_SHORT");
mouseImage.rectTransform.localEulerAngles = new Vector3(0f, 180f, 0f);
}
if (mouseBtnIndex == 1)
{
keyText.text = LanguageManager.Instance.GetText("RIGHT_MOUSE_BUTON_SHORT");
mouseImage.rectTransform.localEulerAngles = new Vector3(0f, 0f, 0f);
}
}
infoText.text = infoT;
cancelText.text = cancelT;
}
}