void DropItems(List <ItemData> dropItems) { foreach (ItemData dropItem in dropItems) { gameItemDrop.DropItemIntoWorld(dropItem, dropTransform.position, ItemPrefabInitilizer.GetPrefabToInstantiate(dropItem), IsDropSingleAmount); } }
void DropItems(List <ItemData> dropItems) { foreach (ItemData dropItem in dropItems) { ItemData data = dropItem.GetComponent <ItemData>(); GameObject model; if (prefabinitilizer != null) { model = prefabinitilizer.GetPrefabToInstantiate(data, defaultDropModelPrefab); } else if (GlobalPrefabInitilizer.prefabInit != null) { model = GlobalPrefabInitilizer.prefabInit.GetPrefabToInstantiate(data, defaultDropModelPrefab); } else { model = defaultDropModelPrefab; } gameItemDrop.DropItemIntoWorld(data, dropTransform.position, model); DestroyObject(dropItem.gameObject); } }
void ItemMoved(MoveMultipleItemsResponse moves, ItemData item) { foreach (MovedItemsInfo moveInfo in moves.movedItems) { DropMovedItem(item, moveInfo); } gameItemDrop.DropItemIntoWorld(item, DropTransform.position, CloudGoods.DefaultItemDrop, false); }
void ItemMoved(MoveMultipleItemsResponse moves, ItemData item) { foreach (MovedItemsInfo moveInfo in moves.movedItems) { DropMovedItem(item, moveInfo); } gameItemDrop.DropItemIntoWorld(item, DropTransform.position, DropObjModel); }
private void DropMovedItems(ItemData[] containerItems, MovedItemsInfo moveInfo) { foreach (ItemData data in containerItems) { if (data.stackID == moveInfo.OriginalStackID) { if (data.ownerContainer != null) { data.ownerContainer.Remove(data, true); } data.stackID = moveInfo.NewStackID; itemDrop.DropItemIntoWorld(data, TransformForDropPosition.position, DropObjDefaultModel, false); } } }