mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-16 07:10:35 +00:00
20 lines
618 B
C#
20 lines
618 B
C#
using QSB.Player;
|
|
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 string LogName => $"{QSBPlayerManager.LocalPlayerId}.{ObjectId}:{GetType().Name}";
|
|
|
|
public abstract void Init(T attachedObject, int id);
|
|
public virtual void PostInit() { }
|
|
public virtual void OnRemoval() { }
|
|
public MonoBehaviour ReturnObject() => AttachedObject;
|
|
}
|
|
}
|