This issue presists since 2.4 something on all my systems. Either Inventory pro doesnt folder like names starting wit _ or im missing somtehing.
But out of the box version of InventoryPro just created a droppable prefab at 0.0.0, keeps original item in scene and links nothing to prefab`s item property.
But i still have to use guid fix in InventoryItemBaseEditor to make items droppable and have to use uniquie names, because of GUID search by name.
Pretty please make it work as intended.
Fix to convert button below:
#!c#
if (GUILayout.Button("Convert to drop object"))
{
var dropObj = item.rarity.dropObject;
var dropInstance = (GameObject)PrefabUtility.InstantiatePrefab(dropObj.gameObject);
var itemTrigger = dropInstance.AddComponent<ItemTrigger>();
//string path = AssetDatabase.GetAssetPath(item);
var guids = AssetDatabase.FindAssets(item.ToString(), new[] { "Assets/_IproData/items" });
for (int i = 0; i < guids.Length; i++)
{
GameObject asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guids[i]), typeof(GameObject)) as GameObject;
//Debug.Log(asset);
if (asset != null)
{
itemTrigger.itemPrefab = asset.GetComponent<InventoryItemBase>();
}
}
//var asset = (GameObject)AssetDatabase.LoadAssetAtPath(path, typeof(GameObject));
dropInstance.transform.SetParent(item.transform.parent);
dropInstance.transform.SetSiblingIndex(item.transform.GetSiblingIndex());
dropInstance.transform.position = item.transform.position;
dropInstance.transform.rotation = item.transform.rotation;
dropInstance.AddComponent<ItemTriggerInputHandler>();
Selection.activeGameObject = itemTrigger.gameObject;
item.StartCoroutine(DestroyImmediateThis(item));
return;
}
Original report by Silvermurk (Bitbucket: Silvermurk, GitHub: Silvermurk).
This issue presists since 2.4 something on all my systems. Either Inventory pro doesn
t folder like names starting wit _ or i
m missing somtehing. But out of the box version of InventoryPro just created a droppable prefab at 0.0.0, keeps original item in scene and links nothing to prefab`s item property. But i still have to use guid fix in InventoryItemBaseEditor to make items droppable and have to use uniquie names, because of GUID search by name. Pretty please make it work as intended.Fix to convert button below: