Evgenij Tsvetkov
Member
Hey! This method finds inventory and monitors it, but a message is displayed in the console that it was not found. This method does not return true.
Code:
/// <summary>
/// Retrieve the monitored Inventory.
/// </summary>
/// <returns>True if the monitored inventory was found.</returns>
protected virtual bool RetrieveAndSetMonitoredInventoryUsingID()
{
if (m_InventoryID == 0)
{
return false;
}
if (InventorySystemManager.InventoryIdentifierRegister.TryGetValue(m_InventoryID,
out var inventoryIdentifier))
{
if (inventoryIdentifier == null || inventoryIdentifier.Inventory == null)
{
return false;
}
SetMonitoredInventory(inventoryIdentifier.Inventory);
}
return false;
}