summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs')
-rw-r--r--Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs
new file mode 100644
index 0000000..2a5f282
--- /dev/null
+++ b/Thronefall_1_57/Decompile/NGS.MeshFusionPro/TransformTrackingStrategy.cs
@@ -0,0 +1,30 @@
+using UnityEngine;
+
+namespace NGS.MeshFusionPro;
+
+public class TransformTrackingStrategy : ISourceTrackingStrategy
+{
+ private Transform _transform;
+
+ private DynamicCombinedObjectPart[] _parts;
+
+ public TransformTrackingStrategy(Transform target, DynamicCombinedObjectPart[] parts)
+ {
+ _transform = target;
+ _parts = parts;
+ }
+
+ public bool OnUpdate()
+ {
+ if (_transform.hasChanged)
+ {
+ for (int i = 0; i < _parts.Length; i++)
+ {
+ _parts[i].Move(_transform.localToWorldMatrix);
+ }
+ _transform.hasChanged = false;
+ return true;
+ }
+ return false;
+ }
+}