//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); }
public RenameEntry(ConfigNode node) { moduleIndex = node.GetIntValue("moduleIndex"); isAction = node.GetBoolValue("isAction"); onTick = node.GetBoolValue("onTick"); eventName = node.GetStringValue("eventName"); newGuiName = node.GetStringValue("newGuiName"); }
public MeshNodeData(ConfigNode inputNode, Part inputPart) { nodeName = inputNode.GetStringValue("name"); if (String.IsNullOrEmpty(nodeName)) { MonoBehaviour.print("ERROR!! : Node name was null for meshswitch node data!!"); } nodeEnabled = inputNode.GetBoolValue("enabled", true); this.part = inputPart; if (inputNode.HasValue("position")) { nodePosition = inputNode.GetVector3("position"); } else if (nodeEnabled == true) { MonoBehaviour.print("ERROR -- no position assigned, but node: " + nodeName + " is enabled for mesh switch"); nodePosition = Vector3.zero; } if (inputNode.HasValue("orientation")) { nodeOrientation = inputNode.GetVector3("orientation"); } else if (nodeEnabled == true) { MonoBehaviour.print("ERROR -- no orientation assigned, but node: " + nodeName + " is enabled for mesh switch"); nodeOrientation = Vector3.zero; } nodeSize = inputNode.GetIntValue("size", 2); }
public SSTUFuelEntry(ConfigNode node) { resourceName = node.GetStringValue("resource"); ratio = node.GetIntValue("ratio", 1); }
public SSTUAnimData(ConfigNode node, Transform transform) { animationName = node.GetStringValue("name"); animationSpeed = node.GetFloatValue("speed", animationSpeed); animationLayer = node.GetIntValue("layer", animationLayer); maxDeployTime = node.GetFloatValue("max", maxDeployTime); setupController(animationName, animationSpeed, animationLayer, transform); }
public SSTUConstraint(ConfigNode node, Transform mover, Transform target, Part part) { this.mover = mover; this.target = target; pass = node.GetIntValue("pass", pass); }
public ModelSwitchData(ConfigNode node, Part owner, ModelSwitchGroup group) { name = node.GetStringValue("name"); modelName = node.GetStringValue("modelName", name); groupName = node.GetStringValue("group", groupName); containerIndex = node.GetIntValue("containerIndex", 0); moduleIDs = node.GetIntValues("managedModuleID", new int[] { }); localPosition = node.GetVector3("localPosition", Vector3.zero); localRotation = node.GetVector3("localRotation", Vector3.zero); scale = node.GetFloatValue("scale", scale); nodes = ModelNodeData.load(node.GetStringValues("node")); suppressNode = nodes.Length > 0; modelDefinition = SSTUModelData.getModelDefinition(modelName); if (modelDefinition == null) { throw new NullReferenceException("Could not locate model data for name: " + modelName + " :: " + name); } this.part = owner; this.group = group; this.group.add(this); }