Example #1
0
        public BagController()
        {
            //初始化五个格子
            m_initBagItemNum = 10;
            //最多10个格子
            m_maxBagItemNum = 10;
            //实例化view和model
            m_bagView    = new BagView();
            m_bagModel   = new BagModel();
            m_equipModel = new EquipModel();
            //m_equipView = new EquipView(m_bagView.m_bagList.transform.parent.GetChild(1));
            //初始化背包格子和数据
            InitBag(m_initBagItemNum, "Prefab/BagGrid");
            //初始化武器格子
            InitGunSlots(m_bagView.m_bag.transform);
            //添加事件监听
            LiteEventManager.Instance.Register(CollectKey.RemoveToBag, AddItemFromColect);

            UIEventManager.Get(m_bagView.closeBtn).OnClickCallBack += CloseView;
        }
Example #2
0
 private void Awake()
 {
     Instance = this;
     Init();
 }