quantum-space-buddies/QSB/WorldSync/WorldObjectManager.cs

29 lines
648 B
C#
Raw Normal View History

2022-01-28 20:49:07 -08:00
using Cysharp.Threading.Tasks;
2022-02-01 08:58:52 +00:00
using QSB.Utility;
2022-01-28 20:49:07 -08:00
using System.Threading;
2022-02-01 14:24:21 -08:00
using UnityEngine;
2021-03-23 13:18:29 +00:00
namespace QSB.WorldSync
{
2021-12-20 18:35:38 -08:00
public enum WorldObjectType
{
Both,
SolarSystem,
Eye
}
2022-02-01 14:24:21 -08:00
public abstract class WorldObjectManager : MonoBehaviour, IAddComponentOnStart
2021-03-23 13:18:29 +00:00
{
2021-12-20 18:35:38 -08:00
/// <summary>
/// when the scene does not match the type, this manager will not build its world objects
/// </summary>
public abstract WorldObjectType WorldObjectType { get; }
2022-01-28 20:50:34 -08:00
public abstract UniTask BuildWorldObjects(OWScene scene, CancellationToken ct);
public virtual void UnbuildWorldObjects() { }
2022-01-25 19:42:22 -08:00
public override string ToString() => GetType().Name;
2021-03-23 13:18:29 +00:00
}
}