2021-01-29 15:29:50 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace QSB.WorldSync
|
2020-08-13 17:25:12 +00:00
|
|
|
|
{
|
2020-12-24 08:41:38 +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; }
|
2021-02-19 21:25:17 +00:00
|
|
|
|
public string Name => AttachedObject == null ? "<NullObject!>" : AttachedObject.name;
|
2020-12-23 22:43:05 +00:00
|
|
|
|
|
|
|
|
|
public abstract void Init(T attachedObject, int id);
|
2021-10-16 22:35:45 +00:00
|
|
|
|
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
|
|
|
|
}
|