B9PartSwitch.PartExtensions.AddResource C# (CSharp) Метод

AddResource() публичный статический Метод

public static AddResource ( this part, PartResourceDefinition info, float maxAmount, float amount ) : PartResource
part this
info PartResourceDefinition
maxAmount float
amount float
Результат PartResource
        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;
        }