123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using Excel2Json;
- using Fort23.Core;
- using Fort23.UTool;
- using GameLogic.Combat;
- using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.UI;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "GuidePanel")]
- public partial class GuidePanel : UIPanel
- {
- private void Init()
- {
- }
- protected override void AddEvent()
- {
- }
- private void SkipGuide()
- {
- PlayerGuideManager.Instance.guideLogic.SkipGuide();
- }
- protected override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- Btn_Skip.onClick.AddListener(async () =>
- {
- // bool isKip = await UIManager.Instance.ShowTips("是否确认跳过引导");
- // if (isKip)
- // SkipGuide();
- });
- Btn_Bg.onClick.AddListener(() =>
- {
- if (PlayerGuideManager.Instance.guideConfig.desc == -1)
- {
- if (PlayerGuideManager.Instance.guideConfig.ForceOnclick == 0)
- {
- PlayerGuideManager.Instance.NextGuide();
- }
- }
- else
- {
- PlayerGuideManager.Instance.dialogBox.OnClickScreen();
- }
- });
- Btn_MessageBG.onClick.AddListener(() => { PlayerGuideManager.Instance.dialogBox.OnClickScreen(); });
- }
-
-
-
- [CustomMethod(customMethodType: CustomMethodType.Update)]
- public void Update()
- {
- // if (UIManager.Instance.currOpenPanel == null || UIManager.Instance.currOpenPanel.GetType() != typeof(MainPanel) || UIManager.Instance.popUIPanels.Count > 0)
- // {
- // return;
- // }
- Vector3 worldPos = CombatDrive.Instance.CombatController.playerHeroEntity.combatHeroGameObject.hpTransform.position;
- Vector3 p = UIManager.Instance.CurrCustomCameraStack.camera.WorldToScreenPoint(worldPos);
- Vector3 p2 = UIManager.Instance.UICamera.ScreenToWorldPoint(p);
- dotPoint.transform.position = p2;
-
-
- }
-
-
- public void SetTarget(GameObject gameObject)
- {
- MyGuideMask.SetTargetImage(gameObject);
- }
- /// <summary>
- /// 设置点击屏蔽
- /// </summary>
- /// <param name="value"></param>
- public void SetOnClickMask(bool value)
- {
- OnClickMask.gameObject.SetActive(value);
- }
- /// <summary>
- /// 设置蒙版点击事件
- /// </summary>
- /// <param name="unityAction"></param>
- public void SetOnClickMaskOnClickAction(UnityAction unityAction)
- {
- OnClickMask.onClick.RemoveAllListeners();
- OnClickMask.onClick.AddListener(unityAction);
- }
- /// <summary>
- /// 设置蒙版大小
- /// </summary>
- /// <param name="size"></param>
- public void SetOnClickMaskSize(Vector2 size)
- {
- OnClickMask.GetComponent<RectTransform>().sizeDelta = size;
- }
- public override void Close()
- {
- base.Close();
- PlayerGuideManager.Instance._timerEntity?.Dispose();
- PlayerGuideManager.Instance._timerEntity = null;
- }
- public override void Hide()
- {
- base.Hide();
- }
- }
- }
|