add
This commit is contained in:
76
Assets/trCRM/Scripts/ui/KKUIScrollView.cs
Normal file
76
Assets/trCRM/Scripts/ui/KKUIScrollView.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using XLua;
|
||||
using Coolape;
|
||||
|
||||
[RequireComponent (typeof(UIScrollView))]
|
||||
public class KKUIScrollView : MonoBehaviour
|
||||
{
|
||||
public CLBaseLua lua;
|
||||
public UICenterOnChild centerOnChild;
|
||||
UIScrollView _scrollView;
|
||||
|
||||
public UIScrollView scrollView {
|
||||
get {
|
||||
if (_scrollView == null)
|
||||
_scrollView = GetComponent<UIScrollView> ();
|
||||
return _scrollView;
|
||||
}
|
||||
}
|
||||
|
||||
public void onDragStarted ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onDragStarted"), scrollView);
|
||||
}
|
||||
|
||||
public void onDragmMove ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onDragmMove"), scrollView);
|
||||
}
|
||||
|
||||
public void onMomentumMove ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onMomentumMove"), scrollView);
|
||||
}
|
||||
|
||||
public void onDragFinished ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onDragFinished"), scrollView);
|
||||
}
|
||||
|
||||
public void onStoppedMoving ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onStoppedMoving"), scrollView);
|
||||
}
|
||||
|
||||
public void onStartCenterOnChild ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onStartCenterOnChild"), scrollView);
|
||||
}
|
||||
|
||||
public void onCenterChild (GameObject center)
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onCenterChild"), center, scrollView);
|
||||
}
|
||||
|
||||
public void onFinishCenterChild ()
|
||||
{
|
||||
Utl.doCallback (lua.getLuaFunction ("onFinishCenterChild"), scrollView);
|
||||
}
|
||||
|
||||
public void Start ()
|
||||
{
|
||||
scrollView.onDragStarted = (UIScrollView.OnDragNotification)onDragStarted;
|
||||
scrollView.onMomentumMove = (UIScrollView.OnDragNotification)onMomentumMove;
|
||||
scrollView.onDragFinished = (UIScrollView.OnDragNotification)onDragFinished;
|
||||
scrollView.onStoppedMoving = (UIScrollView.OnDragNotification)onStoppedMoving;
|
||||
scrollView.onDragmMove = (UIScrollView.OnDragNotification)onDragmMove;
|
||||
scrollView.onStartCenterOnChild = (UIScrollView.OnDragNotification)onStartCenterOnChild;
|
||||
if (centerOnChild != null) {
|
||||
centerOnChild.onFinished = (SpringPanel.OnFinished)onFinishCenterChild;
|
||||
centerOnChild.onCenter = (UICenterOnChild.OnCenterCallback)onCenterChild;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/trCRM/Scripts/ui/KKUIScrollView.cs.meta
Normal file
11
Assets/trCRM/Scripts/ui/KKUIScrollView.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 548490e5985c145d7a7d533ceebb924d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user