diff --git a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll index c6c487cd..ae666dac 100644 Binary files a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll and b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll differ diff --git a/Source/Restock/Constraints/CopyPositionConstraint.cs b/Source/Restock/Constraints/CopyPositionConstraint.cs index dceb4734..5aa14cd4 100644 --- a/Source/Restock/Constraints/CopyPositionConstraint.cs +++ b/Source/Restock/Constraints/CopyPositionConstraint.cs @@ -3,6 +3,10 @@ using UnityEngine; namespace Restock.Constraints { [System.Serializable] + /** + * Copies the position of the target object to the mover object. + * If `IsLocal` is true, uses local position instead of global position. + */ public class CopyPositionConstraint : IConstraint { private readonly string moversName; @@ -16,8 +20,9 @@ namespace Restock.Constraints public CopyPositionConstraint(ConfigNode node, Part p) { - node.TryGetValue("rotatorsName", ref moversName); + node.TryGetValue("moversName", ref moversName); node.TryGetValue("targetName", ref targetName); + node.TryGetValue("isLocal", ref local); mover = p.FindModelTransform(moversName); target = p.FindModelTransform(targetName); diff --git a/Source/Restock/Constraints/CopyRotationConstraint.cs b/Source/Restock/Constraints/CopyRotationConstraint.cs index 99b71b6f..a001b250 100644 --- a/Source/Restock/Constraints/CopyRotationConstraint.cs +++ b/Source/Restock/Constraints/CopyRotationConstraint.cs @@ -3,6 +3,10 @@ using UnityEngine; namespace Restock.Constraints { [System.Serializable] + /** + * Copies the rotation of the target object to the rotator object. + * If `IsLocal` is true, uses local rotation instead of global rotation. + */ public class CopyRotationConstraint : IConstraint { private readonly string rotatorsName; @@ -11,13 +15,14 @@ namespace Restock.Constraints private readonly bool local = false; // Cached components - private readonly Transform target; private readonly Transform rotator; + private readonly Transform target; public CopyRotationConstraint(ConfigNode node, Part p) { node.TryGetValue("rotatorsName", ref rotatorsName); node.TryGetValue("targetName", ref targetName); + node.TryGetValue("isLocal", ref local); rotator = p.FindModelTransform(rotatorsName); target = p.FindModelTransform(targetName); diff --git a/Source/Restock/Constraints/LookAtConstraint.cs b/Source/Restock/Constraints/LookAtConstraint.cs index ef31cc9f..31a43761 100644 --- a/Source/Restock/Constraints/LookAtConstraint.cs +++ b/Source/Restock/Constraints/LookAtConstraint.cs @@ -3,14 +3,17 @@ using UnityEngine; namespace Restock.Constraints { [System.Serializable] + /** + * Points the rotator object at the target object + */ public class LookAtConstraint : IConstraint { private readonly string rotatorsName; private readonly string targetName; // Cached components - private readonly Transform target; private readonly Transform rotator; + private readonly Transform target; public LookAtConstraint(ConfigNode node, Part p) {