| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | /// </summary> |
| | | public class HeroAllAttrWin : UIBase |
| | | { |
| | | [SerializeField] GameObject baseAttrGroup; |
| | | [SerializeField] GameObject fightAttrGroup; |
| | | [SerializeField] GameObject fightAntiAttrGroup; |
| | | [SerializeField] GameObject specialAttrGroup; |
| | | |
| | | [SerializeField] Transform allContent; |
| | | [SerializeField] GameObject baseAttrGroup; |
| | | [SerializeField] GameObject fightAttrGroup; |
| | | [SerializeField] GameObject fightAntiAttrGroup; |
| | | [SerializeField] GameObject specialAttrGroup; |
| | | |
| | | |
| | | |
| | | Dictionary<int, Button> attrBtns = new Dictionary<int, Button>(); |
| | |
| | | { |
| | | SmallTipWin.showText = PlayerPropertyConfig.Get(id).desc; |
| | | SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | UIManager.Instance.OpenWindow<SmallTipWin>(); |
| | | }); |
| | | } |
| | | |
| | | ForceRefreshLayout(); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 强制刷新Layout,解决嵌套Layout和ContentSizeFitter的重叠问题 |
| | | /// </summary> |
| | | async UniTask ForceRefreshLayout() |
| | | { |
| | | await UniTask.DelayFrame(2); |
| | | // 刷新所有Layout组件 |
| | | var layouts = allContent.GetComponentsInChildren<LayoutGroup>(true); |
| | | foreach (var layout in layouts) |
| | | { |
| | | LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); |
| | | } |
| | | await UniTask.DelayFrame(2); |
| | | // 刷新所有Layout组件 |
| | | foreach (var layout in layouts) |
| | | { |
| | | LayoutRebuilder.ForceRebuildLayoutImmediate(layout.GetComponent<RectTransform>()); |
| | | } |
| | | |
| | | } |
| | | } |