remove EnableDisableDetector

This commit is contained in:
JohnCorby 2022-03-27 14:45:09 -07:00
parent 4b457b5e5c
commit 973f91fdad
3 changed files with 0 additions and 33 deletions

View File

@ -1,27 +0,0 @@
using QSB.Utility;
using System;
using UnityEngine;
namespace QSB.EchoesOfTheEye.DreamRafts.WorldObjects;
public class EnableDisableDetector : MonoBehaviour
{
public static void Add(GameObject go, object linkedObject) =>
go.AddComponent<EnableDisableDetector>()._linkedObject = linkedObject;
private object _linkedObject;
private void Start()
{
var body = this.GetAttachedOWRigidbody();
if (body)
{
DebugLog.DebugWrite($"{_linkedObject} suspended = {body.IsSuspended()}");
body.OnSuspendOWRigidbody += _ => DebugLog.DebugWrite($"{_linkedObject} suspend\n{Environment.StackTrace}");
body.OnPreUnsuspendOWRigidbody += _ => DebugLog.DebugWrite($"{_linkedObject} unsuspend\n{Environment.StackTrace}");
}
}
private void OnEnable() => DebugLog.DebugWrite($"{_linkedObject} enable");
private void OnDisable() => DebugLog.DebugWrite($"{_linkedObject} disable");
}

View File

@ -10,9 +10,6 @@ public class QSBDreamRaft : LinkedWorldObject<DreamRaftController, RaftTransform
{
public override void SendInitialState(uint to) { }
public override async UniTask Init(CancellationToken ct) =>
EnableDisableDetector.Add(AttachedObject.gameObject, this);
protected override GameObject NetworkObjectPrefab => QSBNetworkManager.singleton.RaftPrefab;
protected override bool SpawnWithServerAuthority => false;
}

View File

@ -10,9 +10,6 @@ public class QSBSealRaft : LinkedWorldObject<SealRaftController, RaftTransformSy
{
public override void SendInitialState(uint to) { }
public override async UniTask Init(CancellationToken ct) =>
EnableDisableDetector.Add(AttachedObject.gameObject, this);
protected override GameObject NetworkObjectPrefab => QSBNetworkManager.singleton.RaftPrefab;
protected override bool SpawnWithServerAuthority => false;
}