//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, September 07, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.EventSystems;
|
using UnityEngine.UI;
|
|
using vnxbqy.UI;
|
|
namespace vnxbqy.UI {
|
|
public class TempKnapSackBasic : Window
|
{
|
PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
public int lineGird = 5; //每行格子数
|
|
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, int line)
|
{
|
if (gridCtrl.GetNumberOfCells(gridCtrl.m_Scorller) > 0)
|
{
|
gridCtrl.m_Scorller.RefreshActiveCellViews();
|
}
|
else
|
{
|
|
gridCtrl.Refresh();
|
for (int code = 0; code < line; 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,SinglePack pack)
|
{
|
packModel.UnLockPackGrid(selectGridIndex, pack.type);
|
}
|
|
}
|
|
}
|