/// <summary> /// Search for inventory component with maching index. /// </summary> public static MyInventory GetInventory(this MyEntity thisEntity, int index = 0) { MyInventoryBase foundInventoryBase = thisEntity.GetInventoryBase(index); MyInventory rtnInventory = foundInventoryBase as MyInventory; return(rtnInventory); }
public static MyInventory GetInventory(this MyEntity thisEntity, int index = 0) => (thisEntity.GetInventoryBase(index) as MyInventory);