Tz2/Assets/Zion/Scripts/配送/ELP/ELP_Selectmessage.cs

77 lines
2.1 KiB
C#

using Framework.Manager;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class ELP_Selectmessage : MonoBehaviour
{
public InputField inputField_;
public TMP_InputField inputField;
public TextMeshProUGUI textMesh;
public Button select;
public GameObject Panel;
public bool islikenext;
bool inits = false;
void Start()
{
if (transform.name == "ÐèÇóµ¥Î»Panel"|| transform.name == "ÊÕ»õµØÖ·Panel")
{
transform.GetComponent<ELP_Selectmessage>().enabled = false;
}
if (select != null && Panel != null)
{
select.onClick.AddListener(() =>
{
if (inputField.text != "" && textMesh.text.Contains(inputField.text) || textMesh.text.Equals(inputField.text))
{
Panel.SetActive(true);
}
else
{
Panel.SetActive(false);
}
});
}
}
// Update is called once per frame
void Update()
{
if (select == null && Panel != null)
{
if (inputField.text != "" && textMesh.text.Contains(inputField.text) || textMesh.text.Equals(inputField.text))
{
Panel.SetActive(true);
}
else
{
Panel.SetActive(false);
}
}
if (islikenext && !inits)
{
if (inputField != null)
{
if (inputField.text != "" && textMesh.text.Contains(inputField.text) || textMesh.text.Equals(inputField.text))
{
TutorialGuideManager.Instance.TriggerNextGuide();
inits = true;
}
}
else
{
if (inputField_.text != "" && textMesh.text.Equals(inputField_.text))
{
TutorialGuideManager.Instance.TriggerNextGuide();
inits = true;
}
}
}
//Debug.Log("ÊäÈëµÄÊÇ·ñÒ»Ö£º"+ textMesh.text==inputField.text);
}
}