示例#1
0
 void DropItems(List <ItemData> dropItems)
 {
     foreach (ItemData dropItem in dropItems)
     {
         gameItemDrop.DropItemIntoWorld(dropItem, dropTransform.position, ItemPrefabInitilizer.GetPrefabToInstantiate(dropItem), IsDropSingleAmount);
     }
 }
示例#2
0
    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);
        }
    }