예제 #1
0
        public void CreatePlaceableInventory(PlaceableInventory placeableInventory, Vector3 pos, Vector3 eulerAngle)
        {
            var placeData = new InventoryPlaceData()
            {
                pos           = pos,
                eulerAngle    = eulerAngle,
                inventoryName = placeableInventory.inventoryName,
            };

            mapData.inventoryPlaceDataList.Add(placeData);
            PlaceInventory(placeData);
        }
예제 #2
0
        private void PlaceInventory(InventoryPlaceData placeData)
        {
            var inventory = InventoryManager.Instance.GetInventoryByName(placeData.inventoryName) as PlaceableInventory;

            var itemInstance = Instantiate(inventory.itemModel, placeData.pos, Quaternion.Euler(placeData.eulerAngle));

            itemInstance.transform.parent = transform;

            runtimePlaceableInventoryDataList.Add(new RuntimePlaceableInventoryData()
            {
                inventory    = inventory,
                itemInstance = itemInstance,
                placeData    = placeData
            });
        }