12345678910111213141516171819202122232425262728293031323334353637 |
- using DG.Tweening;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class TipsView : MonoBehaviour
- {
- public Text txt_Info;
- public Image img_tips;
- // Start is called before the first frame update
- void Start()
- {
- MessageManager.Instance.OnAddlisten((int)MessageId.Tips, SetContent);
- }
- private void SetContent(object obj)
- {
- object[] content = obj as object[];
- txt_Info.text = content[0].ToString();
- img_tips.gameObject.SetActive(true);
- img_tips.DOFade(1, 2).OnComplete(()=> { img_tips.DOFade(0, 2); img_tips.gameObject.SetActive(false); } );
- }
- private void OnEnable()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
- }
|