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

17 lines
507 B
C#
Raw Normal View History

2021-01-29 15:29:50 +00:00
using UnityEngine;
namespace QSB.WorldSync
2020-08-13 17:25:12 +00:00
{
public abstract class WorldObject<T> : IWorldObject
2021-01-29 15:29:50 +00:00
where T : MonoBehaviour
2020-12-02 21:23:01 +00:00
{
public int ObjectId { get; protected set; }
2020-12-23 22:43:05 +00:00
public T AttachedObject { get; protected set; }
public string Name => AttachedObject == null ? "<NullObject!>" : AttachedObject.name;
2020-12-23 22:43:05 +00:00
public abstract void Init(T attachedObject, int id);
public virtual void PostInit() { }
2021-02-09 21:35:31 +00:00
public virtual void OnRemoval() { }
2021-04-16 10:40:13 +00:00
public MonoBehaviour ReturnObject() => AttachedObject;
2020-12-02 21:23:01 +00:00
}
2020-12-03 08:28:05 +00:00
}