当前位置: 首页>>代码示例>>C#>>正文


C# ConfigNode.GetStringValue方法代码示例

本文整理汇总了C#中System.ConfigNode.GetStringValue方法的典型用法代码示例。如果您正苦于以下问题:C# ConfigNode.GetStringValue方法的具体用法?C# ConfigNode.GetStringValue怎么用?C# ConfigNode.GetStringValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.ConfigNode的用法示例。


在下文中一共展示了ConfigNode.GetStringValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: RenameEntry

 public RenameEntry(ConfigNode node)
 {
     moduleIndex = node.GetIntValue("moduleIndex");
     isAction = node.GetBoolValue("isAction");
     onTick = node.GetBoolValue("onTick");
     eventName = node.GetStringValue("eventName");
     newGuiName = node.GetStringValue("newGuiName");
 }
开发者ID:Joshg213,项目名称:SSTULabs,代码行数:8,代码来源:SSTUEventRename.cs

示例4: TextureData

 public TextureData(ConfigNode node)
 {
     meshName = node.GetStringValue("mesh");
     shaderName = node.GetStringValue("shader");
     diffuseTextureName = node.GetStringValue("diffuseTexture");
     normalTextureName = node.GetStringValue("normalTexture");
     emissiveTextureName = node.GetStringValue("emissiveTexture");
 }
开发者ID:Kerbas-ad-astra,项目名称:SSTULabs,代码行数:8,代码来源:SSTUTextureSet.cs

示例5: MeshConfig

 public MeshConfig(ConfigNode node, Part part)
 {
     variantName = node.GetValue("variantName");
     if (variantName == null || variantName.Length == 0)
     {
         MonoBehaviour.print("ILLEGAL VARIANT NAME: " + variantName);
     }
     tankName = node.GetStringValue("tankName");
     variantMass = (float)node.GetDoubleValue("variantMass");
     variantCost = (float)node.GetDoubleValue("variantCost");
     tankOption = node.GetStringValue("tankOption");
     String meshNames = node.GetStringValue("meshNames");
     if (String.IsNullOrEmpty(meshNames))
     {
         meshData = new MeshData[0];
     }
     else
     {
         String[] splitNames = meshNames.Split(',');
         meshData = new MeshData[splitNames.Length];
         int len = splitNames.Length;
         for (int i = 0; i < len; i++)
         {
             meshData[i] = new MeshData(splitNames[i].Trim(), part);
         }
     }
     String configControlIDs = node.GetStringValue("controlIDs");
     if (String.IsNullOrEmpty(configControlIDs))
     {
         controlledModules = new int[0];
     }
     else
     {
         String[] splitIDs = configControlIDs.Split(',');
         controlledModules = new int[splitIDs.Length];
         for (int i = 0; i < splitIDs.Length; i++) { controlledModules[i] = SSTUUtils.safeParseInt(splitIDs[i].Trim()); }
     }
     ConfigNode[] nodeNodes = node.GetNodes("MESHNODE");
     if (nodeNodes != null && nodeNodes.Length > 0)
     {
         nodeData = new MeshNodeData[nodeNodes.Length];
         int len = nodeNodes.Length;
         for (int i = 0; i < len; i++)
         {
             nodeData[i] = new MeshNodeData(nodeNodes[i], part);
         }
     }
     else
     {
         nodeData = new MeshNodeData[0];
     }
 }
开发者ID:Joshg213,项目名称:SSTULabs,代码行数:52,代码来源:SSTUMeshSwitch.cs

示例6: 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

示例7: loadLookConstraint

 private void loadLookConstraint(ConfigNode node)
 {
     String transformName = node.GetStringValue("transformName");
     String targetName = node.GetStringValue("targetName");
     bool singleTarget = node.GetBoolValue("singleTarget", false);
     Transform[] movers = part.FindModelTransforms(transformName);
     Transform[] targets = part.FindModelTransforms(targetName);
     int len = movers.Length;
     SSTULookConstraint lookConst;
     for (int i = 0; i < len; i++)
     {
         lookConst = new SSTULookConstraint(node, movers[i], singleTarget ? targets[0] : targets[i], part);
         constraints.Add(lookConst);
     }
 }
开发者ID:SixDasher,项目名称:SSTULabs,代码行数:15,代码来源:SSTUModelConstraint.cs

示例8: 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

示例9: 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

示例10: 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

示例11: ParachuteModelData

 public ParachuteModelData(ConfigNode node, Vector3 retracted, Vector3 semi, Vector3 full, int index, bool main)
 {
     name = node.GetStringValue("name");
     definition = SSTUParachuteDefinitions.getDefinition(name);
     modelName = definition.modelName;
     localPosition = node.GetVector3("localPosition");
     retractedUpVector = node.GetVector3("retractedUpVector");
     semiDeployedUpVector = node.GetVector3("semiDeployedUpVector");
     fullDeployedUpVector = node.GetVector3("fullDeployedUpVector");
     texture = node.GetStringValue("texture", texture);
     debug = node.GetBoolValue("debug");
     retractedScale = retracted;
     semiDeployedScale = semi;
     fullDeployedScale = full;
     this.index = index;
     this.main = main;
 }
开发者ID:shadowmage45,项目名称:SSTULabs,代码行数:17,代码来源:SSTUModularParachute.cs

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的System.ConfigNode.GetStringValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。