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.
This commit is contained in:
98
SVSim.BattleEngine/Engine/UIDragScrollView.cs
Normal file
98
SVSim.BattleEngine/Engine/UIDragScrollView.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using UnityEngine;
|
||||
|
||||
[AddComponentMenu("NGUI/Interaction/Drag Scroll View")]
|
||||
public class UIDragScrollView : MonoBehaviour
|
||||
{
|
||||
public UIScrollView scrollView;
|
||||
|
||||
[HideInInspector]
|
||||
[SerializeField]
|
||||
private UIScrollView draggablePanel;
|
||||
|
||||
private Transform mTrans;
|
||||
|
||||
private UIScrollView mScroll;
|
||||
|
||||
private bool mAutoFind;
|
||||
|
||||
private bool mStarted;
|
||||
|
||||
public bool _dragEnabled = true;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
mTrans = base.transform;
|
||||
if (scrollView == null && draggablePanel != null)
|
||||
{
|
||||
scrollView = draggablePanel;
|
||||
draggablePanel = null;
|
||||
}
|
||||
if (mStarted && (mAutoFind || mScroll == null))
|
||||
{
|
||||
FindScrollView();
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
mStarted = true;
|
||||
FindScrollView();
|
||||
}
|
||||
|
||||
private void FindScrollView()
|
||||
{
|
||||
UIScrollView uIScrollView = NGUITools.FindInParents<UIScrollView>(mTrans);
|
||||
if (scrollView == null || (mAutoFind && uIScrollView != scrollView))
|
||||
{
|
||||
scrollView = uIScrollView;
|
||||
mAutoFind = true;
|
||||
}
|
||||
else if (scrollView == uIScrollView)
|
||||
{
|
||||
mAutoFind = true;
|
||||
}
|
||||
mScroll = scrollView;
|
||||
}
|
||||
|
||||
private void OnPress(bool pressed)
|
||||
{
|
||||
if (mAutoFind && mScroll != scrollView)
|
||||
{
|
||||
mScroll = scrollView;
|
||||
mAutoFind = false;
|
||||
}
|
||||
if ((bool)scrollView && base.enabled && NGUITools.GetActive(base.gameObject))
|
||||
{
|
||||
scrollView.Press(pressed);
|
||||
if (!pressed && mAutoFind)
|
||||
{
|
||||
scrollView = NGUITools.FindInParents<UIScrollView>(mTrans);
|
||||
mScroll = scrollView;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrag(Vector2 delta)
|
||||
{
|
||||
if (_dragEnabled && (bool)scrollView && NGUITools.GetActive(this))
|
||||
{
|
||||
scrollView.Drag();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnScroll(float delta)
|
||||
{
|
||||
if ((bool)scrollView && NGUITools.GetActive(this))
|
||||
{
|
||||
scrollView.Scroll(delta);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPan(Vector2 delta)
|
||||
{
|
||||
if ((bool)scrollView && NGUITools.GetActive(this))
|
||||
{
|
||||
scrollView.OnPan(delta);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user