//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, September 07, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.EventSystems;
|
using UnityEngine.UI;
|
|
using Snxxz.UI;
|
|
namespace Snxxz.UI {
|
|
public class TempKnapSackBasic : Window
|
{
|
PackModelInterface _modelInterface;
|
PackModelInterface modelInterface
|
{
|
get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
}
|
|
protected override void BindController()
|
{
|
|
}
|
|
protected override void AddListeners()
|
{
|
|
}
|
|
protected override void OnPreOpen()
|
{
|
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
protected override void OnAfterClose()
|
{
|
|
}
|
|
#region 背包空格的逻辑
|
|
public virtual void OnCreateGridLineCell(ScrollerController gridCtrl)
|
{
|
if (gridCtrl.GetNumberOfCells(gridCtrl.m_Scorller) > 0)
|
{
|
gridCtrl.m_Scorller.RefreshActiveCellViews();
|
}
|
else
|
{
|
|
gridCtrl.Refresh();
|
int code = 0;
|
for (code = 0; code < 20; code++)
|
{
|
gridCtrl.AddCell(ScrollerDataType.Header, code);
|
|
}
|
gridCtrl.Restart();
|
}
|
|
}
|
|
|
//刷新可以使用的格子数
|
public virtual void OnPackCanUseGrid(PackType type) { }
|
|
#endregion
|
|
#region 物品的逻辑
|
|
//生成物品
|
public virtual void OnAddItemCell(PackType type, int index, int id) { }
|
|
public virtual void OnFrenshItemCount(PackType type) { }
|
|
public virtual void ClearBagItem(PackType type) { }
|
|
public virtual void ClearCurrentItem(PackType type, int index) { }
|
|
#endregion
|
|
#region 物品整理
|
|
#endregion
|
|
protected virtual void OnClickLockBtn(int selectGridIndex,SinglePackModel packModel)
|
{
|
modelInterface.OpenGrid(selectGridIndex,packModel.type);
|
}
|
|
}
|
|
}
|