From 673ede6a062433aaeb37f739b5602a3ef56a5d81 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 27 Aug 2022 11:44:52 -0700 Subject: [PATCH] UsedInUnityProjectAttribute --- QSB/Animation/Player/AnimationSync.cs | 1 + QSB/Animation/Player/PlayerHeadRotationSync.cs | 1 + .../Player/Thrusters/JetpackAccelerationSync.cs | 2 ++ .../Player/Thrusters/RemoteThrusterFlameController.cs | 2 ++ .../Player/Thrusters/RemoteThrusterParticlesBehaviour.cs | 1 + .../Player/Thrusters/RemoteThrusterWashController.cs | 1 + QSB/Audio/QSBJetpackThrusterAudio.cs | 5 ++++- QSB/Audio/QSBPlayerAudioController.cs | 4 +++- QSB/Player/PlayerHUDMarker.cs | 1 + QSB/Player/PlayerMapMarker.cs | 4 +++- QSB/Player/RemotePlayerFluidDetector.cs | 1 + QSB/Player/RemotePlayerVelocity.cs | 4 +++- QSB/Player/TransformSync/PlayerTransformSync.cs | 1 + QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs | 4 +++- QSB/PlayerBodySetup/Remote/QSBDitheringAnimator.cs | 4 +++- QSB/RoastingSync/QSBMarshmallow.cs | 2 ++ QSB/Syncs/QSBNetworkTransformChild.cs | 1 + QSB/TimeSync/StopMeditation.cs | 4 +++- QSB/TimeSync/WakeUpSync.cs | 1 + QSB/Tools/FlashlightTool/QSBFlashlight.cs | 1 + QSB/Tools/ProbeLauncherTool/QSBProbeLauncherTool.cs | 4 +++- QSB/Tools/ProbeTool/QSBProbe.cs | 1 + QSB/Tools/ProbeTool/QSBProbeEffects.cs | 1 + QSB/Tools/ProbeTool/QSBProbeLantern.cs | 1 + QSB/Tools/ProbeTool/QSBProbeSpotlight.cs | 1 + QSB/Tools/QSBTool.cs | 1 + QSB/Tools/TranslatorTool/QSBNomaiTranslator.cs | 4 +++- QSB/Tools/TranslatorTool/QSBNomaiTranslatorProp.cs | 4 +++- QSB/Tools/TranslatorTool/QSBTranslatorScanBeam.cs | 4 +++- QSB/Utility/CustomRelativisticParticleSystem.cs | 1 + QSB/Utility/UsedInUnityProjectAttribute.cs | 9 +++++++++ QSB/Utility/VariableSync/BoolVariableSyncer.cs | 5 ++--- QSB/Utility/VariableSync/Vector3VariableSyncer.cs | 1 + 33 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 QSB/Utility/UsedInUnityProjectAttribute.cs diff --git a/QSB/Animation/Player/AnimationSync.cs b/QSB/Animation/Player/AnimationSync.cs index e7e1d18a..035ff2d3 100644 --- a/QSB/Animation/Player/AnimationSync.cs +++ b/QSB/Animation/Player/AnimationSync.cs @@ -12,6 +12,7 @@ using UnityEngine; namespace QSB.Animation.Player; +[UsedInUnityProject] public class AnimationSync : PlayerSyncObject { private RuntimeAnimatorController _suitedAnimController; diff --git a/QSB/Animation/Player/PlayerHeadRotationSync.cs b/QSB/Animation/Player/PlayerHeadRotationSync.cs index cc41f8d5..d5f4867b 100644 --- a/QSB/Animation/Player/PlayerHeadRotationSync.cs +++ b/QSB/Animation/Player/PlayerHeadRotationSync.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Animation.Player; +[UsedInUnityProject] public class PlayerHeadRotationSync : MonoBehaviour { private Animator _attachedAnimator; diff --git a/QSB/Animation/Player/Thrusters/JetpackAccelerationSync.cs b/QSB/Animation/Player/Thrusters/JetpackAccelerationSync.cs index 4ce65696..c8b6c55a 100644 --- a/QSB/Animation/Player/Thrusters/JetpackAccelerationSync.cs +++ b/QSB/Animation/Player/Thrusters/JetpackAccelerationSync.cs @@ -1,8 +1,10 @@ using Mirror; +using QSB.Utility; using QSB.Utility.VariableSync; namespace QSB.Animation.Player.Thrusters; +[UsedInUnityProject] public class JetpackAccelerationSync : NetworkBehaviour { public Vector3VariableSyncer AccelerationVariableSyncer; diff --git a/QSB/Animation/Player/Thrusters/RemoteThrusterFlameController.cs b/QSB/Animation/Player/Thrusters/RemoteThrusterFlameController.cs index 999e3914..3f3e2280 100644 --- a/QSB/Animation/Player/Thrusters/RemoteThrusterFlameController.cs +++ b/QSB/Animation/Player/Thrusters/RemoteThrusterFlameController.cs @@ -1,9 +1,11 @@ using QSB.Player; +using QSB.Utility; using QSB.WorldSync; using UnityEngine; namespace QSB.Animation.Player.Thrusters; +[UsedInUnityProject] internal class RemoteThrusterFlameController : MonoBehaviour { [SerializeField] diff --git a/QSB/Animation/Player/Thrusters/RemoteThrusterParticlesBehaviour.cs b/QSB/Animation/Player/Thrusters/RemoteThrusterParticlesBehaviour.cs index b28c9f66..535ce1a4 100644 --- a/QSB/Animation/Player/Thrusters/RemoteThrusterParticlesBehaviour.cs +++ b/QSB/Animation/Player/Thrusters/RemoteThrusterParticlesBehaviour.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Animation.Player.Thrusters; +[UsedInUnityProject] internal class RemoteThrusterParticlesBehaviour : MonoBehaviour { [SerializeField] diff --git a/QSB/Animation/Player/Thrusters/RemoteThrusterWashController.cs b/QSB/Animation/Player/Thrusters/RemoteThrusterWashController.cs index ffa1dd60..0b41d519 100644 --- a/QSB/Animation/Player/Thrusters/RemoteThrusterWashController.cs +++ b/QSB/Animation/Player/Thrusters/RemoteThrusterWashController.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Animation.Player.Thrusters; +[UsedInUnityProject] internal class RemoteThrusterWashController : MonoBehaviour { [SerializeField] diff --git a/QSB/Audio/QSBJetpackThrusterAudio.cs b/QSB/Audio/QSBJetpackThrusterAudio.cs index e43f0b41..8cd38ae6 100644 --- a/QSB/Audio/QSBJetpackThrusterAudio.cs +++ b/QSB/Audio/QSBJetpackThrusterAudio.cs @@ -1,5 +1,8 @@ -namespace QSB.Audio; +using QSB.Utility; +namespace QSB.Audio; + +[UsedInUnityProject] internal class QSBJetpackThrusterAudio : QSBThrusterAudio { public OWAudioSource _underwaterSource; diff --git a/QSB/Audio/QSBPlayerAudioController.cs b/QSB/Audio/QSBPlayerAudioController.cs index c5ebe457..9030065c 100644 --- a/QSB/Audio/QSBPlayerAudioController.cs +++ b/QSB/Audio/QSBPlayerAudioController.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.Audio; +[UsedInUnityProject] public class QSBPlayerAudioController : MonoBehaviour { public OWAudioSource _oneShotExternalSource; diff --git a/QSB/Player/PlayerHUDMarker.cs b/QSB/Player/PlayerHUDMarker.cs index e680bb12..82131999 100644 --- a/QSB/Player/PlayerHUDMarker.cs +++ b/QSB/Player/PlayerHUDMarker.cs @@ -3,6 +3,7 @@ using UnityEngine; namespace QSB.Player; +[UsedInUnityProject] public class PlayerHUDMarker : HUDDistanceMarker { private PlayerInfo _player; diff --git a/QSB/Player/PlayerMapMarker.cs b/QSB/Player/PlayerMapMarker.cs index 07f87890..4d35a734 100644 --- a/QSB/Player/PlayerMapMarker.cs +++ b/QSB/Player/PlayerMapMarker.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.Player; +[UsedInUnityProject] public class PlayerMapMarker : MonoBehaviour { private PlayerInfo _player; diff --git a/QSB/Player/RemotePlayerFluidDetector.cs b/QSB/Player/RemotePlayerFluidDetector.cs index 50def10e..a732999c 100644 --- a/QSB/Player/RemotePlayerFluidDetector.cs +++ b/QSB/Player/RemotePlayerFluidDetector.cs @@ -7,6 +7,7 @@ using UnityEngine; namespace QSB.Player; +[UsedInUnityProject] public class RemotePlayerFluidDetector : PriorityDetector { private SplashEffect[] _splashEffects; diff --git a/QSB/Player/RemotePlayerVelocity.cs b/QSB/Player/RemotePlayerVelocity.cs index 5b5c87f0..80d6c251 100644 --- a/QSB/Player/RemotePlayerVelocity.cs +++ b/QSB/Player/RemotePlayerVelocity.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.Player; +[UsedInUnityProject] public class RemotePlayerVelocity : MonoBehaviour { private Vector3 _prevRelPosition; diff --git a/QSB/Player/TransformSync/PlayerTransformSync.cs b/QSB/Player/TransformSync/PlayerTransformSync.cs index 496e2395..52fc4d7d 100644 --- a/QSB/Player/TransformSync/PlayerTransformSync.cs +++ b/QSB/Player/TransformSync/PlayerTransformSync.cs @@ -12,6 +12,7 @@ using Gizmos = Popcron.Gizmos; namespace QSB.Player.TransformSync; +[UsedInUnityProject] public class PlayerTransformSync : SectoredTransformSync { protected override bool IsPlayerObject => true; diff --git a/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs b/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs index 9f9d52d9..b43db3e7 100644 --- a/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs +++ b/QSB/PlayerBodySetup/Remote/DreamWorldSpawnAnimator.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.PlayerBodySetup.Remote; +[UsedInUnityProject] public class DreamWorldSpawnAnimator : MonoBehaviour { [SerializeField] diff --git a/QSB/PlayerBodySetup/Remote/QSBDitheringAnimator.cs b/QSB/PlayerBodySetup/Remote/QSBDitheringAnimator.cs index d982c35a..6889e7fa 100644 --- a/QSB/PlayerBodySetup/Remote/QSBDitheringAnimator.cs +++ b/QSB/PlayerBodySetup/Remote/QSBDitheringAnimator.cs @@ -1,9 +1,11 @@ -using System.Linq; +using QSB.Utility; +using System.Linq; using UnityEngine; using UnityEngine.Rendering; namespace QSB.PlayerBodySetup.Remote; +[UsedInUnityProject] public class QSBDitheringAnimator : MonoBehaviour { public bool FullyVisible => !enabled && OWMath.ApproxEquals(_visibleFraction, 1); diff --git a/QSB/RoastingSync/QSBMarshmallow.cs b/QSB/RoastingSync/QSBMarshmallow.cs index 747770c8..db755f58 100644 --- a/QSB/RoastingSync/QSBMarshmallow.cs +++ b/QSB/RoastingSync/QSBMarshmallow.cs @@ -1,9 +1,11 @@ using QSB.Player; +using QSB.Utility; using System.Linq; using UnityEngine; namespace QSB.RoastingSync; +[UsedInUnityProject] public class QSBMarshmallow : MonoBehaviour { public const float RAW_TOASTED_FRACTION = 0.2f; diff --git a/QSB/Syncs/QSBNetworkTransformChild.cs b/QSB/Syncs/QSBNetworkTransformChild.cs index b96fc084..b3336e01 100644 --- a/QSB/Syncs/QSBNetworkTransformChild.cs +++ b/QSB/Syncs/QSBNetworkTransformChild.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Syncs; +[UsedInUnityProject] public class QSBNetworkTransformChild : QSBNetworkBehaviour { public Transform Target; diff --git a/QSB/TimeSync/StopMeditation.cs b/QSB/TimeSync/StopMeditation.cs index 4a7dddc1..36149fad 100644 --- a/QSB/TimeSync/StopMeditation.cs +++ b/QSB/TimeSync/StopMeditation.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.TimeSync; +[UsedInUnityProject] public class StopMeditation : MonoBehaviour { public void Init() diff --git a/QSB/TimeSync/WakeUpSync.cs b/QSB/TimeSync/WakeUpSync.cs index 671fce3c..f18564a9 100644 --- a/QSB/TimeSync/WakeUpSync.cs +++ b/QSB/TimeSync/WakeUpSync.cs @@ -16,6 +16,7 @@ using UnityEngine; namespace QSB.TimeSync; +[UsedInUnityProject] public class WakeUpSync : NetworkBehaviour { public static WakeUpSync LocalInstance { get; private set; } diff --git a/QSB/Tools/FlashlightTool/QSBFlashlight.cs b/QSB/Tools/FlashlightTool/QSBFlashlight.cs index 6f1b60dc..440c24f6 100644 --- a/QSB/Tools/FlashlightTool/QSBFlashlight.cs +++ b/QSB/Tools/FlashlightTool/QSBFlashlight.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Tools.FlashlightTool; +[UsedInUnityProject] public class QSBFlashlight : MonoBehaviour, ILightSource { [SerializeField] diff --git a/QSB/Tools/ProbeLauncherTool/QSBProbeLauncherTool.cs b/QSB/Tools/ProbeLauncherTool/QSBProbeLauncherTool.cs index 244b6b0d..67c6c9f1 100644 --- a/QSB/Tools/ProbeLauncherTool/QSBProbeLauncherTool.cs +++ b/QSB/Tools/ProbeLauncherTool/QSBProbeLauncherTool.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.Tools.ProbeLauncherTool; +[UsedInUnityProject] public class QSBProbeLauncherTool : QSBTool { public GameObject PreLaunchProbeProxy; diff --git a/QSB/Tools/ProbeTool/QSBProbe.cs b/QSB/Tools/ProbeTool/QSBProbe.cs index 45881b8c..01377301 100644 --- a/QSB/Tools/ProbeTool/QSBProbe.cs +++ b/QSB/Tools/ProbeTool/QSBProbe.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Tools.ProbeTool; +[UsedInUnityProject] public class QSBProbe : MonoBehaviour, ILightSource { public delegate void SurveyorProbeEvent(); diff --git a/QSB/Tools/ProbeTool/QSBProbeEffects.cs b/QSB/Tools/ProbeTool/QSBProbeEffects.cs index bc0f5bad..b1545309 100644 --- a/QSB/Tools/ProbeTool/QSBProbeEffects.cs +++ b/QSB/Tools/ProbeTool/QSBProbeEffects.cs @@ -5,6 +5,7 @@ using UnityEngine; namespace QSB.Tools.ProbeTool; +[UsedInUnityProject] internal class QSBProbeEffects : MonoBehaviour { public OWAudioSource _flightLoopAudio; diff --git a/QSB/Tools/ProbeTool/QSBProbeLantern.cs b/QSB/Tools/ProbeTool/QSBProbeLantern.cs index 74365302..6269a14d 100644 --- a/QSB/Tools/ProbeTool/QSBProbeLantern.cs +++ b/QSB/Tools/ProbeTool/QSBProbeLantern.cs @@ -5,6 +5,7 @@ using UnityEngine; namespace QSB.Tools.ProbeTool; +[UsedInUnityProject] internal class QSBProbeLantern : MonoBehaviour { public float _fadeInDuration; diff --git a/QSB/Tools/ProbeTool/QSBProbeSpotlight.cs b/QSB/Tools/ProbeTool/QSBProbeSpotlight.cs index 2e235cd2..68c6f371 100644 --- a/QSB/Tools/ProbeTool/QSBProbeSpotlight.cs +++ b/QSB/Tools/ProbeTool/QSBProbeSpotlight.cs @@ -5,6 +5,7 @@ using UnityEngine; namespace QSB.Tools.ProbeTool; +[UsedInUnityProject] internal class QSBProbeSpotlight : MonoBehaviour { public ProbeCamera.ID _id; diff --git a/QSB/Tools/QSBTool.cs b/QSB/Tools/QSBTool.cs index d3633673..0885143e 100644 --- a/QSB/Tools/QSBTool.cs +++ b/QSB/Tools/QSBTool.cs @@ -5,6 +5,7 @@ using UnityEngine; namespace QSB.Tools; +[UsedInUnityProject] public class QSBTool : PlayerTool { public PlayerInfo Player { get; set; } diff --git a/QSB/Tools/TranslatorTool/QSBNomaiTranslator.cs b/QSB/Tools/TranslatorTool/QSBNomaiTranslator.cs index 46209451..aaf41bf7 100644 --- a/QSB/Tools/TranslatorTool/QSBNomaiTranslator.cs +++ b/QSB/Tools/TranslatorTool/QSBNomaiTranslator.cs @@ -1,7 +1,9 @@ -using UnityEngine; +using QSB.Utility; +using UnityEngine; namespace QSB.Tools.TranslatorTool; +[UsedInUnityProject] public class QSBNomaiTranslator : QSBTool { public static float distToClosestTextCenter = 1f; diff --git a/QSB/Tools/TranslatorTool/QSBNomaiTranslatorProp.cs b/QSB/Tools/TranslatorTool/QSBNomaiTranslatorProp.cs index 8a266dd3..c825e5b8 100644 --- a/QSB/Tools/TranslatorTool/QSBNomaiTranslatorProp.cs +++ b/QSB/Tools/TranslatorTool/QSBNomaiTranslatorProp.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; +using QSB.Utility; +using System.Collections.Generic; using System.Text; using UnityEngine; using UnityEngine.UI; namespace QSB.Tools.TranslatorTool; +[UsedInUnityProject] internal class QSBNomaiTranslatorProp : MonoBehaviour { private static MaterialPropertyBlock s_matPropBlock; diff --git a/QSB/Tools/TranslatorTool/QSBTranslatorScanBeam.cs b/QSB/Tools/TranslatorTool/QSBTranslatorScanBeam.cs index a94e6a27..adc484ca 100644 --- a/QSB/Tools/TranslatorTool/QSBTranslatorScanBeam.cs +++ b/QSB/Tools/TranslatorTool/QSBTranslatorScanBeam.cs @@ -1,8 +1,10 @@ -using QSB.WorldSync; +using QSB.Utility; +using QSB.WorldSync; using UnityEngine; namespace QSB.Tools.TranslatorTool; +[UsedInUnityProject] internal class QSBTranslatorScanBeam : MonoBehaviour { public Renderer _projectorRenderer; diff --git a/QSB/Utility/CustomRelativisticParticleSystem.cs b/QSB/Utility/CustomRelativisticParticleSystem.cs index c93ee048..65520af1 100644 --- a/QSB/Utility/CustomRelativisticParticleSystem.cs +++ b/QSB/Utility/CustomRelativisticParticleSystem.cs @@ -4,6 +4,7 @@ using UnityEngine; namespace QSB.Utility; +[UsedInUnityProject] internal class CustomRelativisticParticleSystem : MonoBehaviour { private ParticleSystem _particleSystem; diff --git a/QSB/Utility/UsedInUnityProjectAttribute.cs b/QSB/Utility/UsedInUnityProjectAttribute.cs new file mode 100644 index 00000000..c6f21a2f --- /dev/null +++ b/QSB/Utility/UsedInUnityProjectAttribute.cs @@ -0,0 +1,9 @@ +using System; + +namespace QSB.Utility; + +/// +/// denotes that the given type is used in the unity project +/// and therefore caution should be used when moving/renaming/deleting +/// +public class UsedInUnityProjectAttribute : Attribute { } diff --git a/QSB/Utility/VariableSync/BoolVariableSyncer.cs b/QSB/Utility/VariableSync/BoolVariableSyncer.cs index 73338da5..e021aab5 100644 --- a/QSB/Utility/VariableSync/BoolVariableSyncer.cs +++ b/QSB/Utility/VariableSync/BoolVariableSyncer.cs @@ -1,5 +1,4 @@ namespace QSB.Utility.VariableSync; -public class BoolVariableSyncer : BaseVariableSyncer -{ -} \ No newline at end of file +[UsedInUnityProject] +public class BoolVariableSyncer : BaseVariableSyncer { } diff --git a/QSB/Utility/VariableSync/Vector3VariableSyncer.cs b/QSB/Utility/VariableSync/Vector3VariableSyncer.cs index 88471499..1ca8a5a4 100644 --- a/QSB/Utility/VariableSync/Vector3VariableSyncer.cs +++ b/QSB/Utility/VariableSync/Vector3VariableSyncer.cs @@ -2,6 +2,7 @@ namespace QSB.Utility.VariableSync; +[UsedInUnityProject] public class Vector3VariableSyncer : BaseVariableSyncer { ///