mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 21:32:47 +00:00
28 lines
582 B
C#
28 lines
582 B
C#
using QSB.Utility;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.WorldSync
|
|
{
|
|
public abstract class WorldObjectManager : MonoBehaviour
|
|
{
|
|
private static 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);
|
|
}
|
|
}
|