public virtual void DragToThisGrid(ArticleItem articleItem) { //清空以前格子 BagGrid lastGrid = articleItem.transform.parent.GetComponent <BagGrid>(); if (this.articleItem == null) { lastGrid.ClearGrid(); SetArticleItem(articleItem); } else { //交换 lastGrid.SetArticleItem(this.articleItem); SetArticleItem(articleItem); } }
public void DragToThisGrid(ArticleItem articleItem) { //清空以前的格子 BagGrid lastGrid = articleItem.transform.parent.GetComponent <BagGrid>(); //判断这个格子有没有物品 if (this.articleItem == null) { //清空格子 lastGrid.ClearGrid(); //设置 SetArticleItem(articleItem); } else { //要进行交换 lastGrid.SetArticleItem(this.articleItem); //设置 SetArticleItem(articleItem); } }
void Awake() { UIType.InitUIType( isClearStack: false, isESCClose: true, isClickElsewhereClose: false, uiForms_Type: UIFormTypes.Normal, uiForms_ShowMode: UIFormShowModes.Normal, uiForm_LucencyType: UIFormLucencyTypes.Penetrable); BagManager.Instance.BagItemGridSize = Mathf.RoundToInt(ItemContainerGridLayout.cellSize.x); for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { BagGrid big = GameObjectPoolManager.Instance.PoolDict[GameObjectPoolManager.PrefabNames.BagGrid].AllocateGameObject <BagGrid>(GridContainer); big.State = BagGrid.States.Unavailable; bagGridMatrix[j, i] = big; } } }