public static PartResource AddResource(this Part part, PartResourceDefinition info, float maxAmount, float amount)
{
PartResource resource = new PartResource(part);
resource.SetInfo(info);
resource.maxAmount = maxAmount;
resource.amount = amount;
resource.flowState = true;
resource.isTweakable = info.isTweakable;
resource.isVisible = info.isVisible;
resource.hideFlow = false;
resource.flowMode = PartResource.FlowMode.Both;
part.Resources.dict.Add(info.name.GetHashCode(), resource);
return resource;
}