123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using ShadowStudio.UI;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- using XRTool.Util;
- public class ScanPictureBtn : UnitySingleton<ScanPictureBtn>,IPointerEnterHandler,IPointerExitHandler
- {
- private Button scanPictureBtn;
- private Transform BtnTip;
- public Transform Bg;
- private Animator animator;
- protected override void Awake()
- {
- base.Awake();
- scanPictureBtn = transform.GetComponent<Button>();
- BtnTip = UnityUtil.GetBreadthChild<Transform>(transform, "BtnTip");
- Bg = UnityUtil.GetBreadthChild<Transform>(transform, "Bg");
- animator = UnityUtil.GetBreadthChild<Animator>(transform, "Action");
- scanPictureBtn.onClick.AddListener(OnClick);
- }
- private void OnClick()
- {
- if (ConsoleDlg.Instance)
- {
- ConsoleDlg.Instance.ClickOnScan();
-
- }
- }
- public void OnPointerEnter(PointerEventData eventData)
- {
- if (BtnTip && animator)
- {
- BtnTip.gameObject.SetActive(true);
- animator.SetBool("Show", true);
- }
- }
- public void OnPointerExit(PointerEventData eventData)
- {
- if (BtnTip && animator)
- {
- BtnTip.gameObject.SetActive(false);
- animator.SetBool("Show", false);
- }
- }
- }
|