mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
rename IWorldObject.ReturnObject to AttachedObject
This commit is contained in:
parent
8fbc946252
commit
503c0b85cc
@ -17,7 +17,7 @@ namespace QSB.ItemSync.WorldObjects.Sockets
|
||||
=> AttachedObject.IsSocketOccupied();
|
||||
|
||||
public virtual bool PlaceIntoSocket(IQSBOWItem item)
|
||||
=> AttachedObject.PlaceIntoSocket((OWItem)item.ReturnObject());
|
||||
=> AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject);
|
||||
|
||||
public virtual IQSBOWItem RemoveFromSocket()
|
||||
=> AttachedObject.RemoveFromSocket().GetWorldObject<IQSBOWItem>();
|
||||
|
@ -17,7 +17,7 @@ namespace QSB.ItemSync.WorldObjects.Sockets
|
||||
=> AttachedObject.IsSocketOccupied();
|
||||
|
||||
public virtual bool PlaceIntoSocket(IQSBOWItem item)
|
||||
=> AttachedObject.PlaceIntoSocket((OWItem)item.ReturnObject());
|
||||
=> AttachedObject.PlaceIntoSocket((OWItem)item.AttachedObject);
|
||||
|
||||
public virtual IQSBOWItem RemoveFromSocket()
|
||||
=> AttachedObject.RemoveFromSocket().GetWorldObject<IQSBOWItem>();
|
||||
|
@ -258,14 +258,14 @@ namespace QSB.Utility
|
||||
|
||||
foreach (var obj in QSBWorldSync.GetWorldObjects())
|
||||
{
|
||||
if (obj.ReturnObject() == null)
|
||||
if (obj.AttachedObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (obj.ShouldDisplayDebug())
|
||||
{
|
||||
DrawLabel(obj.ReturnObject().transform, obj.ReturnLabel());
|
||||
DrawLabel(obj.AttachedObject.transform, obj.ReturnLabel());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -279,7 +279,7 @@ namespace QSB.Utility
|
||||
|
||||
foreach (var obj in QSBWorldSync.GetWorldObjects())
|
||||
{
|
||||
if (obj.ReturnObject() == null)
|
||||
if (obj.AttachedObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -6,9 +6,9 @@ namespace QSB.WorldSync
|
||||
{
|
||||
int ObjectId { get; }
|
||||
string Name { get; }
|
||||
MonoBehaviour AttachedObject { get; }
|
||||
|
||||
void OnRemoval();
|
||||
MonoBehaviour ReturnObject();
|
||||
bool ShouldDisplayDebug();
|
||||
string ReturnLabel();
|
||||
void DisplayLines();
|
||||
|
@ -6,13 +6,13 @@ namespace QSB.WorldSync
|
||||
where T : MonoBehaviour
|
||||
{
|
||||
public int ObjectId { get; init; }
|
||||
MonoBehaviour IWorldObject.AttachedObject => AttachedObject;
|
||||
public T AttachedObject { get; init; }
|
||||
public string Name => AttachedObject ? AttachedObject.name : "<NullObject!>";
|
||||
public override string ToString() => $"{ObjectId}:{GetType().Name} ({Name})";
|
||||
|
||||
public virtual void Init() { }
|
||||
public virtual void OnRemoval() { }
|
||||
public MonoBehaviour ReturnObject() => AttachedObject;
|
||||
public virtual bool ShouldDisplayDebug() => QSBWorldSync.AllObjectsReady && AttachedObject && AttachedObject.gameObject.activeInHierarchy;
|
||||
public virtual string ReturnLabel() => ToString();
|
||||
public virtual void DisplayLines() { }
|
||||
|
Loading…
Reference in New Issue
Block a user