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:
42
SVSim.BattleEngine/Engine/UICenterOnClick.cs
Normal file
42
SVSim.BattleEngine/Engine/UICenterOnClick.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Interaction/Center Scroll View on Click")]
|
||||
public class UICenterOnClick : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Transform _otherCenteringTarget;
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
UICenterOnChild uICenterOnChild = NGUITools.FindInParents<UICenterOnChild>(base.gameObject);
|
||||
UIPanel uIPanel = NGUITools.FindInParents<UIPanel>(base.gameObject);
|
||||
if (uICenterOnChild != null)
|
||||
{
|
||||
if (uICenterOnChild.enabled)
|
||||
{
|
||||
if (_otherCenteringTarget != null)
|
||||
{
|
||||
uICenterOnChild.CenterOn(_otherCenteringTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
uICenterOnChild.CenterOn(base.transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (uIPanel != null && uIPanel.clipping != UIDrawCall.Clipping.None)
|
||||
{
|
||||
UIScrollView component = uIPanel.GetComponent<UIScrollView>();
|
||||
Vector3 pos = -uIPanel.cachedTransform.InverseTransformPoint(base.transform.position);
|
||||
if (!component.canMoveHorizontally)
|
||||
{
|
||||
pos.x = uIPanel.cachedTransform.localPosition.x;
|
||||
}
|
||||
if (!component.canMoveVertically)
|
||||
{
|
||||
pos.y = uIPanel.cachedTransform.localPosition.y;
|
||||
}
|
||||
SpringPanel.Begin(uIPanel.cachedGameObject, pos, 6f);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user