I’ve been staring at this for a couple of days now, I know that System.Reflection can dynamically call a method from a string but I cant find a way to get anything to do it dynamically for a definition to return a value
var resourceRequired = "resource" + resourceNumber + "Amount";
if (spacePeon.maximumCarryAmount > assignedSite.GetComponent<Buildingconstruction>().resourceRequired)
{
pickupamount = assignedsite.GetComponent<Buildingconstruction>().resourcerequired;
}
resourceRequired should return an int value but I cannot for the life of me work out how to do this