mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-04 03:39:55 +00:00
Merge branch 'orb-tracking' into conversation-system
This commit is contained in:
commit
834992807e
@ -23,7 +23,7 @@ namespace QSB.OrbSync
|
||||
return false;
|
||||
}
|
||||
var orbDistance = Vector3.Distance(orb.transform.position, __instance.transform.position);
|
||||
var triggerRadius = !orb.IsBeingDragged() ? ____radius : ____exitRadius;
|
||||
var triggerRadius = orb.IsBeingDragged() ? ____exitRadius : ____radius;
|
||||
if (____occupyingOrb == null && orbDistance < ____radius)
|
||||
{
|
||||
____occupyingOrb = orb;
|
||||
@ -35,7 +35,7 @@ namespace QSB.OrbSync
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
if (!(____occupyingOrb != null) || !(____occupyingOrb == orb))
|
||||
if (____occupyingOrb == null || ____occupyingOrb != orb)
|
||||
{
|
||||
__result = false;
|
||||
return false;
|
||||
|
@ -6,11 +6,6 @@ namespace QSB.OrbSync
|
||||
public class OrbSlotManager : MonoBehaviour
|
||||
{
|
||||
private void Awake()
|
||||
{
|
||||
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(OWScene scene, bool isInUniverse)
|
||||
{
|
||||
QSB.Helper.Events.Unity.RunWhen(() => QSB.HasWokenUp, InitSlots);
|
||||
}
|
||||
@ -22,7 +17,6 @@ namespace QSB.OrbSync
|
||||
{
|
||||
var qsbOrbSlot = WorldRegistry.GetObject<QSBOrbSlot>(id) ?? new QSBOrbSlot();
|
||||
qsbOrbSlot.Init(orbSlots[id], id);
|
||||
WorldRegistry.AddObject(qsbOrbSlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ namespace QSB.OrbSync
|
||||
ObjectId = id;
|
||||
InterfaceSlot = slot;
|
||||
_initialized = true;
|
||||
WorldRegistry.AddObject(this);
|
||||
}
|
||||
|
||||
public void HandleEvent(bool state)
|
||||
|
@ -14,14 +14,6 @@ namespace QSB.Utility
|
||||
.GetMethods(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)
|
||||
.Last(x => x.Name == "WriteLine");
|
||||
var callingType = GetCallingType(new StackTrace());
|
||||
if (callingType == "DebugLog")
|
||||
{
|
||||
callingType = GetCallingType(new StackTrace(), 2);
|
||||
}
|
||||
if (callingType == "DebugLog")
|
||||
{
|
||||
callingType = GetCallingType(new StackTrace(), 3);
|
||||
}
|
||||
method.Invoke(console, new object[] { type, message, callingType });
|
||||
}
|
||||
|
||||
@ -56,16 +48,10 @@ namespace QSB.Utility
|
||||
DebugWrite($"* {name} {status}", messageType);
|
||||
}
|
||||
|
||||
private static string GetCallingType(StackTrace frame, int index = 1)
|
||||
private static string GetCallingType(StackTrace frame)
|
||||
{
|
||||
try
|
||||
{
|
||||
return frame.GetFrame(index).GetMethod().DeclaringType.Name;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var stackFrame = frame.GetFrames().First(x => x.GetMethod().DeclaringType.Name != "DebugLog");
|
||||
return stackFrame.GetMethod().DeclaringType.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user