| | |
| | | using DG.Tweening; |
| | | using System.Linq; |
| | | using System; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | //工人是固定的跟随模式,监工是随机分配的,场上的监工数量会比实际更多 |
| | | //分配监工 |
| | |
| | | wordArr[index].SetActive(true); |
| | | wordArr[index].Play(); |
| | | textArr[index].text = Language.Get(content); |
| | | ForceRefreshLayout(); |
| | | } |
| | | else if (posEvent == PosEvent.TargetAction) |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 强制刷新Layout,解决嵌套Layout和ContentSizeFitter的重叠问题 |
| | | /// </summary> |
| | | async UniTask ForceRefreshLayout() |
| | | { |
| | | await UniTask.DelayFrame(2); |
| | | foreach (var word in wordArr) |
| | | { |
| | | LayoutRebuilder.ForceRebuildLayoutImmediate(word.GetComponent<RectTransform>()); |
| | | } |
| | | } |
| | | |
| | | |
| | | void AssignLeader(int addCount) |