少年修仙传客户端代码仓库
hch
2025-07-24 50e53441950268933694eeb5aad36147bbe1014d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//--------------------------------------------------------
//    [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);
        }
 
    }
 
}