summaryrefslogtreecommitdiff
path: root/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs')
-rw-r--r--Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs b/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs
new file mode 100644
index 0000000..f9aaed8
--- /dev/null
+++ b/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/Tracker.cs
@@ -0,0 +1,34 @@
+using UnityEngine;
+
+public class Tracker : MonoBehaviour
+{
+ private bool m_active;
+
+ private void Awake()
+ {
+ ZNetView component = GetComponent<ZNetView>();
+ if ((bool)component && component.IsOwner())
+ {
+ m_active = true;
+ ZNet.instance.SetReferencePosition(base.transform.position);
+ }
+ }
+
+ public void SetActive(bool active)
+ {
+ m_active = active;
+ }
+
+ private void OnDestroy()
+ {
+ m_active = false;
+ }
+
+ private void FixedUpdate()
+ {
+ if (m_active)
+ {
+ ZNet.instance.SetReferencePosition(base.transform.position);
+ }
+ }
+}