summaryrefslogtreecommitdiff
path: root/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs')
-rw-r--r--Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs b/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs
new file mode 100644
index 0000000..2871f3d
--- /dev/null
+++ b/Valheim_v0.141.2_r202102/Valheim/assembly_valheim/SlowUpdate.cs
@@ -0,0 +1,34 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SlowUpdate : MonoBehaviour
+{
+ private static List<SlowUpdate> m_allInstances = new List<SlowUpdate>();
+
+ private int m_myIndex = -1;
+
+ public virtual void Awake()
+ {
+ m_allInstances.Add(this);
+ m_myIndex = m_allInstances.Count - 1;
+ }
+
+ public virtual void OnDestroy()
+ {
+ if (m_myIndex != -1)
+ {
+ m_allInstances[m_myIndex] = m_allInstances[m_allInstances.Count - 1];
+ m_allInstances[m_myIndex].m_myIndex = m_myIndex;
+ m_allInstances.RemoveAt(m_allInstances.Count - 1);
+ }
+ }
+
+ public virtual void SUpdate()
+ {
+ }
+
+ public static List<SlowUpdate> GetAllInstaces()
+ {
+ return m_allInstances;
+ }
+}