本文整理汇总了C#中ItemData.AssetBundle方法的典型用法代码示例。如果您正苦于以下问题:C# ItemData.AssetBundle方法的具体用法?C# ItemData.AssetBundle怎么用?C# ItemData.AssetBundle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemData
的用法示例。
在下文中一共展示了ItemData.AssetBundle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DropItemIntoWorld
public void DropItemIntoWorld(ItemData item, Vector3 dropPosition, GameObject dropModelDefault)
{
if (item != null)
{
List<ItemData> items = new List<ItemData>();
items.Add(item);
List<GameObject> dropItems = ItemConverter.ConvertToItemDropObject(items, true);
if(dropParentObject == null)
dropParentObject = new GameObject("DroppedItems");
foreach (GameObject dropItem in dropItems)
{
item.AssetBundle(
(UnityEngine.Object bundleObj) =>
{
GameObject dropObject;
if (bundleObj != null)
dropObject = GameObjectInitilizer.initilizer.InitilizeGameObject(bundleObj);
else
dropObject = GameObjectInitilizer.initilizer.InitilizeGameObject(dropModelDefault);
ItemData itemData = dropObject.AddComponent<ItemData>();
itemData.SetItemData(item);
ItemComponentInitalizer.InitializeItemWithComponents(dropObject.GetComponent<ItemData>(), AddComponetTo.prefab);
dropObject.transform.position = dropPosition;
dropObject.transform.parent = dropParentObject.transform;
if (postDropObjectAction != null)
postDropObjectAction.DoGameObjectAction(dropObject);
}
);
Destroy(dropItem);
}
}
}
示例2: equipment_AddedItem
void equipment_AddedItem(ItemData item, bool isSave)
{
item.AssetBundle(GetItemCallback);
currentItem = item;
}