Hi would be nice to be able to Get the current items count in a specific storage by ResourceName
Currentrly i'm using this:
//------------------------------------------------------------------------------------------------ static int GetStorageItemCountByResource(IEntity storageEntity, ResourceName resourceName) { int count = 0; if(!storageEntity || !resourceName) return 0; array<IEntity> outItems = {}; ClothNodeStorageComponent clothNode = ClothNodeStorageComponent.Cast(storageEntity.FindComponent(ClothNodeStorageComponent)); if(clothNode) { clothNode.GetAll(outItems); foreach (IEntity ent0 : outItems) { count = count + GetStorageItemCountByResource(ent0,resourceName); } } else { BaseInventoryStorageComponent storage = BaseInventoryStorageComponent.Cast(storageEntity.FindComponent(BaseInventoryStorageComponent)); if(!storage) return 0; storage.GetAll(outItems); foreach (IEntity ent : outItems) { ResourceName rn = ent.GetPrefabData().GetPrefabName(); if(rn == resourceName) count = count +1; } } return count; }