feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
64
SVSim.BattleEngine/Engine/Wizard/PaginationDots.cs
Normal file
64
SVSim.BattleEngine/Engine/Wizard/PaginationDots.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class PaginationDots : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private UIGrid _dotsGrid;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _dotSpriteOriginal;
|
||||
|
||||
private List<UISprite> _dotSprites = new List<UISprite>();
|
||||
|
||||
public void Init(int pageNum, int dotSpriteSize, int gridCellWidth, int depth)
|
||||
{
|
||||
UISprite dotSpriteOriginal = _dotSpriteOriginal;
|
||||
int width = (_dotSpriteOriginal.height = dotSpriteSize);
|
||||
dotSpriteOriginal.width = width;
|
||||
_dotSpriteOriginal.depth = depth;
|
||||
_dotsGrid.cellWidth = gridCellWidth;
|
||||
ChangePageNum(pageNum);
|
||||
}
|
||||
|
||||
public void SetActivePageNumber(int pageNo)
|
||||
{
|
||||
SetActivePageIndex(pageNo - 1);
|
||||
}
|
||||
|
||||
public void SetActivePageIndex(int pageIndex)
|
||||
{
|
||||
for (int i = 0; i < _dotSprites.Count; i++)
|
||||
{
|
||||
_dotSprites[i].spriteName = ((i == pageIndex) ? "carousel_marker_on" : "carousel_marker_off");
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangePageNum(int num)
|
||||
{
|
||||
if (num <= 1)
|
||||
{
|
||||
foreach (UISprite dotSprite in _dotSprites)
|
||||
{
|
||||
dotSprite.gameObject.SetActive(value: false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (int i = _dotSprites.Count; i < num; i++)
|
||||
{
|
||||
UISprite component = NGUITools.AddChild(_dotsGrid.gameObject, _dotSpriteOriginal.gameObject).GetComponent<UISprite>();
|
||||
_dotSprites.Add(component);
|
||||
}
|
||||
for (int j = 0; j < num; j++)
|
||||
{
|
||||
_dotSprites[j].gameObject.SetActive(value: true);
|
||||
}
|
||||
for (int k = num; k < _dotSprites.Count; k++)
|
||||
{
|
||||
_dotSprites[k].gameObject.SetActive(value: false);
|
||||
}
|
||||
_dotsGrid.Reposition();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user