diff options
| author | chai <215380520@qq.com> | 2024-05-20 22:35:55 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2024-05-20 22:35:55 +0800 |
| commit | 1cefa46d7cbff46fc14c44ab36b4976047b98c70 (patch) | |
| tree | 49c376cfd996749de8ec2b8e08456ec46cfc2b3b /Valheim_r202102_v0.141.2/Valheim/assembly_valheim/SlowUpdate.cs | |
| parent | db64ca2ebcfc2239702ba53e3497b44cd14d8c27 (diff) | |
*rename
Diffstat (limited to 'Valheim_r202102_v0.141.2/Valheim/assembly_valheim/SlowUpdate.cs')
| -rw-r--r-- | Valheim_r202102_v0.141.2/Valheim/assembly_valheim/SlowUpdate.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/SlowUpdate.cs b/Valheim_r202102_v0.141.2/Valheim/assembly_valheim/SlowUpdate.cs new file mode 100644 index 0000000..2871f3d --- /dev/null +++ b/Valheim_r202102_v0.141.2/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; + } +} |
