Mister_Nebula 6ed3d46659 stuff
2021-04-16 11:40:13 +01:00

18 lines
557 B
C#

using QSB.TransformSync;
using UnityEngine;
namespace QSB.WorldSync
{
public abstract class WorldObject<T> : IWorldObject
where T : MonoBehaviour
{
public int ObjectId { get; protected set; }
public T AttachedObject { get; protected set; }
public string Name => AttachedObject == null ? "<NullObject!>" : AttachedObject.name;
public WorldObjectTransformSync TransformSync { get; set; }
public abstract void Init(T attachedObject, int id);
public virtual void OnRemoval() { }
public MonoBehaviour ReturnObject() => AttachedObject;
}
}