當前位置: 首頁>>代碼示例>>C#>>正文


C# ConfigNode.GetFloatValue方法代碼示例

本文整理匯總了C#中System.ConfigNode.GetFloatValue方法的典型用法代碼示例。如果您正苦於以下問題:C# ConfigNode.GetFloatValue方法的具體用法?C# ConfigNode.GetFloatValue怎麽用?C# ConfigNode.GetFloatValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.ConfigNode的用法示例。


在下文中一共展示了ConfigNode.GetFloatValue方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: load

 //to be called on initial prefab part load; populate the instance with the default values from the input node
 public virtual void load(ConfigNode node, GameObject root)
 {
     fairingBase = new FairingContainer(root, cylinderSides, numOfSections, wallThickness);
     uvMapName = node.GetStringValue("uvMap", uvMapName);
     UVMap uvMap = UVMap.GetUVMapGlobal(uvMapName);
     fairingBase.outsideUV = uvMap.getArea("outside");
     fairingBase.insideUV = uvMap.getArea("inside");
     fairingBase.edgesUV = uvMap.getArea("edges");
     rotationOffset = node.GetVector3("rotationOffset", Vector3.zero);
     topY = node.GetFloatValue("topY", topY);
     bottomY = node.GetFloatValue("bottomY", bottomY);
     capSize = node.GetFloatValue("capSize", capSize);
     wallThickness = node.GetFloatValue("wallThickness", wallThickness);
     maxPanelHeight = node.GetFloatValue("maxPanelHeight", maxPanelHeight);
     cylinderSides = node.GetIntValue("cylinderSides", cylinderSides);
     numOfSections = node.GetIntValue("numOfSections", numOfSections);
     topRadius = node.GetFloatValue("topRadius", topRadius);
     bottomRadius = node.GetFloatValue("bottomRadius", bottomRadius);
     canAdjustTop = node.GetBoolValue("canAdjustTop", canAdjustTop);
     canAdjustBottom = node.GetBoolValue("canAdjustBottom", canAdjustBottom);
     removeMass = node.GetBoolValue("removeMass", removeMass);
     fairingJettisonMass = node.GetFloatValue("fairingJettisonMass", fairingJettisonMass);
     jettisonForce = node.GetFloatValue("jettisonForce", jettisonForce);
     jettisonDirection = node.GetVector3("jettisonDirection", jettisonDirection);
     fairingName = node.GetStringValue("name", fairingName);
 }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:27,代碼來源:FairingData.cs

示例2: SRBModelData

 public SRBModelData(ConfigNode node)
     : base(node)
 {
     minThrust = node.GetFloatValue("minThrust");
     maxThrust = node.GetFloatValue("maxThrust");
     engineConfig = node.GetStringValue("engineConfig");
 }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:7,代碼來源:SSTUModularBooster.cs

示例3: SRBNozzleData

 public SRBNozzleData(ConfigNode node)
     : base(node)
 {
     thrustTransformName = node.GetStringValue("thrustTransformName");
     gimbalTransformName = node.GetStringValue("gimbalTransformName");
     gimbalAdjustmentRange = node.GetFloatValue("gimbalAdjustRange", 0);
     gimbalFlightRange = node.GetFloatValue("gimbalFlightRange", 0);
 }
開發者ID:Joshg213,項目名稱:SSTULabs,代碼行數:8,代碼來源:SSTUModularBooster.cs

示例4: HeatShieldType

 public HeatShieldType(ConfigNode node)
 {
     name = node.GetStringValue("name");
     heatCurve = node.GetFloatCurve("heatCurve");
     resourceMult = node.GetFloatValue("resourceMult", resourceMult);
     ablationMult = node.GetFloatValue("ablationMult", ablationMult);
     massMult = node.GetFloatValue("massMult", massMult);
 }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:8,代碼來源:SSTUModularHeatShield.cs

示例5: FuelTypeData

 public FuelTypeData(ConfigNode node)
 {
     name = node.GetStringValue("name");
     fuelType = FuelTypes.INSTANCE.getFuelType(name);
     if (fuelType == null) { throw new NullReferenceException("Fuel type was null for fuel name: " + name); }
     tankageVolumeLoss = node.GetFloatValue("tankageVolumeLoss", fuelType.tankageVolumeLoss);
     tankageMassFraction = node.GetFloatValue("tankageMassFraction", fuelType.tankageMassFactor);
     costPerDryTon = node.GetFloatValue("costPerDryTon", fuelType.costPerDryTon);
 }
開發者ID:SixDasher,項目名稱:SSTULabs,代碼行數:9,代碼來源:FuelType.cs

示例6: ModelData

 public ModelData(ConfigNode node)
 {
     name = node.GetStringValue("name");
     modelDefinition = SSTUModelData.getModelDefinition(name);
     if (modelDefinition==null)
     {
         MonoBehaviour.print("ERROR: Could not locate model data for name: " + name);
     }
     minVerticalScale = node.GetFloatValue("minVerticalScale", 1f);
     maxVerticalScale = node.GetFloatValue("maxVerticalScale", 1f);
 }
開發者ID:Joshg213,項目名稱:SSTULabs,代碼行數:11,代碼來源:ModelData.cs

示例7: EngineMount

 public EngineMount(ConfigNode node)
 {
     name = node.GetStringValue("name");
     layoutNames = node.GetValues("layoutName");
     defaultDiameter = node.GetFloatValue("size", defaultDiameter);
     minDiameter = node.GetFloatValue("minSize", minDiameter);
     maxDiameter = node.GetFloatValue("maxSize", maxDiameter);
     engineSpacing = node.GetFloatValue("engineSpacing", engineSpacing);
     canAdjustSize = node.GetBoolValue("canAdjustSize", canAdjustSize);
     rotateEngineModels = node.GetBoolValues("rotateEngines");
     mountDefinition = SSTUEngineMountDefinition.getMountDefinition(name);
 }
開發者ID:SixDasher,項目名稱:SSTULabs,代碼行數:12,代碼來源:EngineMount.cs

示例8: SSTUEngineLayout

        public SSTUEngineLayout(ConfigNode node)
        {
            name = node.GetStringValue("name");
            mountSizeMult = node.GetFloatValue("mountSizeMult", mountSizeMult);
            defaultUpperStageMount = node.GetStringValue("defaultUpperStageMount", defaultUpperStageMount);
            defaultLowerStageMount = node.GetStringValue("defaultLowerStageMount", defaultLowerStageMount);

            ConfigNode[] posNodes = node.GetNodes("POSITION");
            int len = posNodes.Length;
            for (int i = 0; i < len; i++)
            {
                positions.Add(new SSTUEnginePosition(posNodes[i]));
            }

            ConfigNode[] mountNodes = node.GetNodes("MOUNT");
            len = mountNodes.Length;
            List<SSTUEngineLayoutMountOption> mountOptionsList = new List<SSTUEngineLayoutMountOption>();

            string mountName;
            ModelDefinition md;
            for (int i = 0; i < len; i++)
            {
                mountName = mountNodes[i].GetStringValue("name");
                md = SSTUModelData.getModelDefinition(mountName);
                if (md != null)
                {
                    mountOptionsList.Add(new SSTUEngineLayoutMountOption(mountNodes[i]));
                }
                else
                {
                    MonoBehaviour.print("ERROR: Could not locate mount model data for name: " + mountName + " -- please check your configs for errors.");
                }
            }
            mountOptions = mountOptionsList.ToArray();
        }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:35,代碼來源:SSTUEngineLayout.cs

示例9: SSTUFuelType

 public SSTUFuelType(ConfigNode node)
 {
     name = node.GetStringValue("name");
     tankageVolumeLoss = node.GetFloatValue("tankageVolumeLoss");
     tankageMassFactor = node.GetFloatValue("tankageMassFactor", 1);
     costPerDryTon = node.GetFloatValue("costPerDryTon");
     ConfigNode[] fuelConfigs = node.GetNodes("RESOURCE");
     SSTUFuelEntry e = null;
     foreach(ConfigNode n in fuelConfigs)
     {
         e = new SSTUFuelEntry(n);
         fuelEntries.Add(e);
         litersPerUnit += SSTUFuelTypes.INSTANCE.getResourceVolume(e.resourceName) * e.ratio;
         costPerUnit += PartResourceLibrary.Instance.GetDefinition(e.resourceName).unitCost * e.ratio;
     }
     unitsPerCubicMeter = 1000f / litersPerUnit;
     MonoBehaviour.print("Loaded SSTU_FUEL TYPE: "+name+"  units/m3: "+unitsPerCubicMeter+"  costPerUnit: "+costPerUnit +"  costPerM3: "+(unitsPerCubicMeter*costPerUnit));
 }
開發者ID:Kerbas-ad-astra,項目名稱:SSTULabs,代碼行數:18,代碼來源:SSTUFuelType.cs

示例10: LightData

        public LightType type; //read

        #endregion Fields

        #region Constructors

        public LightData(ConfigNode node, Part part)
        {
            name = node.GetStringValue("name");
            intensity = node.GetFloatValue("intensity");
            range = node.GetFloatValue("range");
            angle = node.GetFloatValue("angle");
            type = (LightType)Enum.Parse(typeof(LightType), node.GetStringValue("type", LightType.Point.ToString()));

            transform = part.transform.FindRecursive(name);
            light = transform.GetComponent<Light>();
            if (light == null)
            {
                light = transform.gameObject.AddComponent<Light>();//add it if it does not exist
            }

            light.intensity = intensity;
            light.range = range;
            light.spotAngle = angle;
            light.type = type;
        }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:26,代碼來源:SSTUAnimateLight.cs

示例11: FuelType

 public FuelType(ConfigNode node)
 {
     name = node.GetStringValue("name");
     tankageVolumeLoss = node.GetFloatValue("tankageVolumeLoss", 0.15f);
     tankageMassFactor = node.GetFloatValue("tankageMassFactor", 0.15f);
     costPerDryTon = node.GetFloatValue("costPerDryTon");
     ConfigNode[] fuelConfigs = node.GetNodes("RESOURCE");
     SSTUFuelEntry e = null;
     PartResourceDefinition def;
     float massPerUnit = 0;
     foreach (ConfigNode n in fuelConfigs)
     {
         e = new SSTUFuelEntry(n);
         fuelEntries.Add(e);
         litersPerUnit += FuelTypes.INSTANCE.getResourceVolume(e.resourceName) * e.ratio;
         def = PartResourceLibrary.Instance.GetDefinition(e.resourceName);
         costPerUnit += def.unitCost * e.ratio;
         massPerUnit += def.density * e.ratio;
     }
     unitsPerCubicMeter = 1000f / litersPerUnit;
     tonsPerCubicMeter = massPerUnit * unitsPerCubicMeter;
 }
開發者ID:Joshg213,項目名稱:SSTULabs,代碼行數:22,代碼來源:FuelType.cs

示例12: ShaderProperty

 public ShaderProperty(ConfigNode node)
 {
     name = node.GetStringValue("name");
     if (node.HasValue("float"))
     {
         fVal = true;
         floatVal = node.GetFloatValue("float");
     }
     else
     {
         fVal = false;
         colorVal = node.getColor("color");
     }
 }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:14,代碼來源:SSTUAssetBundleShaderLoader.cs

示例13: ModelData

 public ModelData(ConfigNode node)
 {
     name = node.GetStringValue("name", String.Empty);
     modelName = node.GetStringValue("modelName", String.Empty);
     techLimit = node.GetStringValue("techLimit", techLimit);
     height = node.GetFloatValue("height", height);
     volume = node.GetFloatValue("volume", volume);
     mass = node.GetFloatValue("mass", mass);
     cost = node.GetFloatValue("cost", cost);
     diameter = node.GetFloatValue("diameter", diameter);
     verticalOffset = node.GetFloatValue("verticalOffset", verticalOffset);
     invertModel = node.GetBoolValue("invertModel", invertModel);
 }
開發者ID:SixDasher,項目名稱:SSTULabs,代碼行數:13,代碼來源:ModelData.cs

示例14: SolarData

 public SolarData(ConfigNode node)
 {
     name = node.GetStringValue("name");
     modelName = node.GetStringValue("modelName", name);
     upgradeName = node.GetStringValue("upgrade");
     def = SSTUModelData.getModelDefinition(modelName);
     ConfigNode solarNode = def.configNode.GetNode("SOLARDATA");
     animationName = solarNode.GetStringValue("animationName");
     pivotNames = solarNode.GetStringValue("pivotNames");
     secPivotNames = solarNode.GetStringValue("secPivotNames");
     sunNames = solarNode.GetStringValue("sunNames");
     energy = solarNode.GetFloatValue("energy");
     panelsEnabled = solarNode.GetBoolValue("enabled");
     sunAxis = solarNode.GetStringValue("sunAxis", SSTUSolarPanelDeployable.Axis.ZPlus.ToString());
     energy = node.GetFloatValue("energy", energy);//allow local override of energy
     ConfigNode[] posNodes = node.GetNodes("POSITION");
     int len = posNodes.Length;
     positions = new SolarPosition[len];
     for (int i = 0; i < len; i++)
     {
         positions[i] = new SolarPosition(posNodes[i]);
     }
 }
開發者ID:shadowmage45,項目名稱:SSTULabs,代碼行數:23,代碼來源:SSTUModularStationCore.cs

示例15: SSTUCustomUpperStageIntertank

 public SSTUCustomUpperStageIntertank(ConfigNode node) : base(node)
 {
     ratio = node.GetFloatValue("ratio", ratio);
     fairingOffset = node.GetFloatValue("fairingOffset", fairingOffset);
 }
開發者ID:SixDasher,項目名稱:SSTULabs,代碼行數:5,代碼來源:SSTUCustomUpperStage.cs


注:本文中的System.ConfigNode.GetFloatValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。