//do the actual generation here void GenerateResource(ResourcePool resourcePool) { //set here the value randomly each time based on the generationRate float thisValue = UnityEngine.Random.Range(resourcePool.minUnitSize, resourcePool.maxUnitSize); resourcePool.AddResources(thisValue); }