quantum-space-buddies/QSB/WorldSync/WorldObjectManager.cs
Mister_Nebula 85b800d120 cleanup
2021-03-25 22:01:10 +00:00

27 lines
571 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace QSB.WorldSync
{
public abstract class WorldObjectManager : MonoBehaviour
{
private static readonly List<WorldObjectManager> _managers = new List<WorldObjectManager>();
public virtual void Awake()
=> _managers.Add(this);
public virtual void OnDestroy()
=> _managers.Remove(this);
public static void Rebuild(OWScene scene)
{
foreach (var manager in _managers)
{
manager.RebuildWorldObjects(scene);
}
}
protected abstract void RebuildWorldObjects(OWScene scene);
}
}