Files
tianrunCRM/Assets/CoolapeFrame/Scripts/ui/NguiExtend/UIDragPage4Lua.cs
2020-07-04 14:41:25 +08:00

58 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
********************************************************************************
*Copyright(C),coolae.net
*Author: wangkaiyuan
*Version: 2.0
*Date: 2017-01-09
*Description: 拖动滑动一页比如可以用在关卡地图页面绑定lua
*Others:
*History:
*********************************************************************************
*/
using UnityEngine;
using System.Collections;
using XLua;
namespace Coolape
{
[RequireComponent (typeof(CLCellLua))]
public class UIDragPage4Lua : UIDragPageContents
{
public CLCellLua uiLua;
bool isFinishInit = false;
LuaFunction lfInit = null;
LuaFunction lfrefresh = null;
LuaFunction lfrefreshCurrent = null;
public override void init (object obj, int index)
{
if (!isFinishInit) {
isFinishInit = true;
if (uiLua != null) {
uiLua.setLua ();
lfInit = uiLua.getLuaFunction ("init");
lfrefresh = uiLua.getLuaFunction ("refresh");
lfrefreshCurrent = uiLua.getLuaFunction ("refreshCurrent");
}
if (lfInit != null) {
uiLua.call(lfInit, uiLua);
}
}
if (lfrefresh != null) {
uiLua.call (lfrefresh, obj, index);
}
}
public override void refreshCurrent (int pageIndex, object obj)
{
init (obj, pageIndex);
if (lfrefreshCurrent != null) {
uiLua.call (lfrefreshCurrent, pageIndex, obj);
}
}
}
}