예제 #1
0
        private void SetVirtualGridPos(GridPosR gridPos_World)
        {
            UIInventory.UIInventoryPanel.UIInventoryVirtualOccupationQuadRoot.Clear();
            foreach (GridPos gp_matrix in InventoryItem.OccupiedGridPositions_Matrix)
            {
                if (!UIInventory.ContainsGP(gp_matrix))
                {
                    continue;
                }

                UIInventoryVirtualOccupationQuad quad = UIInventory.CreateUIInventoryItemVirtualOccupationQuad(UIInventory.UIInventoryPanel.UIInventoryVirtualOccupationQuadRoot.transform);
                quad.Init(InventoryItem.Inventory.GridSize, gp_matrix, InventoryItem.Inventory);
                UIInventory.UIInventoryPanel.UIInventoryVirtualOccupationQuadRoot.uiInventoryVirtualOccupationQuads.Add(quad);
            }
        }
예제 #2
0
        public UIInventoryVirtualOccupationQuad CreateUIInventoryItemVirtualOccupationQuad(Transform transform)
        {
            if (InstantiateUIInventoryItemVirtualOccupationQuadHandler != null)
            {
                MonoBehaviour mono = InstantiateUIInventoryItemVirtualOccupationQuadHandler?.Invoke(transform);
                if (mono != null)
                {
                    try
                    {
                        UIInventoryVirtualOccupationQuad res = (UIInventoryVirtualOccupationQuad)mono;
                        return(res);
                    }
                    catch (Exception e)
                    {
                        LogError(e.ToString());
                    }
                }
            }

            return(null);
        }