This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-06-26 13:08:34 +08:00
parent d767e2b9de
commit 1749191071

View File

@ -115,7 +115,7 @@ namespace GameLogic
#endregion #endregion
private Dictionary<RectTransform, Vector2> targetPositions = new Dictionary<RectTransform, Vector2>(); private Dictionary<RectTransform, Vector2> targetPositions = new Dictionary<RectTransform, Vector2>();
private float animationSpeed = 140f; // Adjust this value to control the speed of the animation private float animationSpeed = 143f; // Adjust this value to control the speed of the animation
protected override void OnCreate() protected override void OnCreate()
{ {
base.OnCreate(); base.OnCreate();
@ -143,7 +143,7 @@ namespace GameLogic
// 计算位置 // 计算位置
r.anchorMin = new Vector2(0.5f, 0.5f); r.anchorMin = new Vector2(0.5f, 0.5f);
r.anchorMax = new Vector2(0.5f, 0.5f); r.anchorMax = new Vector2(0.5f, 0.5f);
r.anchoredPosition = new Vector2(127, 373 - 65 - i * (140 - 5f)); r.anchoredPosition = new Vector2(127, 373 - 65 - i * (143 - 5f));
r.localPosition = new Vector3(r.localPosition.x, r.localPosition.y, 0); r.localPosition = new Vector3(r.localPosition.x, r.localPosition.y, 0);
actorHItem.OnInit(i); actorHItem.OnInit(i);
DataGameSceneManager.Instance.m_DicTeamList.Add((i + 1).ToString(), actorHItem); DataGameSceneManager.Instance.m_DicTeamList.Add((i + 1).ToString(), actorHItem);
@ -709,7 +709,7 @@ namespace GameLogic
var hItemActor = hItemActors[i].actor; var hItemActor = hItemActors[i].actor;
//hItemActor.m_Index = i; //hItemActor.m_Index = i;
var rectTransform = hItemActor.gameObject.GetComponent<RectTransform>(); var rectTransform = hItemActor.gameObject.GetComponent<RectTransform>();
Vector2 targetPosition = new Vector2(127, 373 - i * (140 - 5f)); Vector2 targetPosition = new Vector2(127, 373 - i * (143 - 5f));
targetPositions[rectTransform] = targetPosition; targetPositions[rectTransform] = targetPosition;
// 让UI层级与排序一致 // 让UI层级与排序一致