Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/MyRotationParts.cs
gamer147 0d9d8acae0 feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
2026-06-05 16:57:20 -04:00

58 lines
1.5 KiB
C#

using UnityEngine;
namespace Wizard;
public class MyRotationParts : MonoBehaviour
{
[SerializeField]
private UISprite _backGround;
[SerializeField]
private UILabel _packNameLabel;
[SerializeField]
private FlexibleGrid _backGroundGrid;
[SerializeField]
private UIGrid _bonusIconGrid;
[SerializeField]
private GameObject _bonusIconOriginal;
private const int BACK_GROUND_PACK_NAME_OFFSET = 20;
private const int BACK_GROUND_ICON_OFFSET = 28;
public void SetMyRotationInfo(MyRotationInfo myRotationInfo)
{
if (myRotationInfo == null)
{
return;
}
if (_packNameLabel != null)
{
_packNameLabel.text = myRotationInfo.LastPackText;
}
_bonusIconOriginal.SetActive(value: false);
_bonusIconGrid.transform.DestroyChildren();
foreach (MyRotationInfo.MyRotationBonus ability in myRotationInfo.Abilities)
{
GameObject obj = NGUITools.AddChild(_bonusIconGrid.gameObject, _bonusIconOriginal);
obj.GetComponent<UISprite>().spriteName = ability.IconName;
obj.SetActive(value: true);
}
_bonusIconGrid.Reposition();
if (_backGround != null)
{
_backGround.rightAnchor.target = ((myRotationInfo.Abilities.Count > 0) ? _bonusIconGrid.transform : _packNameLabel.transform);
_backGround.rightAnchor.absolute = ((myRotationInfo.Abilities.Count > 0) ? 28 : 20);
}
}
public void Reposition()
{
_backGroundGrid.Reposition();
StartCoroutine(_backGroundGrid.RepositionNextFrame());
}
}