using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using System.IO; using DG.Tweening; using UnityEngine.UI; public class UITipShow : MonoBehaviour { public static UITipShow instance; public TextMeshProUGUI tipText; public Button showBtn; public Button hideBtn; string basePage=Application.streamingAssetsPath; private void Awake() { instance = this; Debug.Log(transform.GetChild(0).position); } // Start is called before the first frame update void Start() { showBtn.onClick.AddListener(ShowTip); hideBtn.onClick.AddListener(HideTip); //UpDateTipText("流程说明/122流程.txt"); HideTip(); } public void UpDateTipText(string path) { string resultPath = Path.Combine(basePage, path); tipText.text = File.ReadAllText(resultPath); } public void ClearTipText() { tipText.text = string.Empty; gameObject.SetActive(false); } public void ShowTip() { transform.GetChild(0).DOLocalMoveX(960, 0.5f); showBtn.gameObject.SetActive(false); hideBtn.gameObject.SetActive(true); } public void HideTip() { transform.GetChild(0).DOLocalMoveX(1243, 0.5f); showBtn.gameObject.SetActive(true); hideBtn.gameObject.SetActive(false); } }