From 311edc09aa939f1ab19420f432735226c91bdd14 Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:55:54 -0400 Subject: [PATCH] chore: Updated AddComponentMenu attributes --- .../Experimental/NetworkLerpRigidbody.cs | 2 +- .../LagCompensation/HistoryCollider.cs | 2 ++ .../Components/LagCompensation/LagCompensator.cs | 1 + .../Components/NetworkDiagnosticsDebugger.cs | 1 + .../NetworkRigidbody/NetworkRigidbodyReliable.cs | 1 + .../NetworkRigidbodyReliable2D.cs | 1 + .../NetworkRigidbodyUnreliable.cs | 1 + .../NetworkRigidbodyUnreliable2D.cs | 1 + Assets/Mirror/Examples/Basic/Scripts/Player.cs | 1 + .../NetworkManagerPredictionBenchmark.cs | 1 + .../Scripts/NetworkManagerCharacterSelection.cs | 1 + .../Mirror/Examples/Room/Scripts/PlayerCamera.cs | 1 + .../Examples/Room/Scripts/PlayerController.cs | 1 + .../Mirror/Examples/Room/Scripts/PlayerScore.cs | 1 + Assets/Mirror/Examples/Room/Scripts/Reward.cs | 1 + .../NetworkManagerStackedPrediction.cs | 1 + .../Scripts/AuthorityNetworkManager.cs | 2 ++ .../CanvasNetworkManagerHUD.cs | 1 + .../Examples/_Common/Scripts/RandomColor.cs | 1 + .../Examples/_Common/Scripts/RandomColor.cs.meta | 2 +- .../Mirror/Tests/Common/NetworkBehaviourMock.cs | 3 +++ .../AttributeNetworkBehaviour.cs | 3 +++ .../NetworkIdentityTests_Common.cs | 16 ++++++++++++++++ 23 files changed, 44 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Components/Experimental/NetworkLerpRigidbody.cs b/Assets/Mirror/Components/Experimental/NetworkLerpRigidbody.cs index adca7cbb1..f3be8c894 100644 --- a/Assets/Mirror/Components/Experimental/NetworkLerpRigidbody.cs +++ b/Assets/Mirror/Components/Experimental/NetworkLerpRigidbody.cs @@ -3,7 +3,7 @@ namespace Mirror.Experimental { - [AddComponentMenu("Network/ Experimental/Network Lerp Rigidbody")] + [AddComponentMenu("")] [HelpURL("https://mirror-networking.gitbook.io/docs/components/network-lerp-rigidbody")] [Obsolete("Use the new NetworkRigidbodyReliable/Unreliable component with Snapshot Interpolation instead.")] public class NetworkLerpRigidbody : NetworkBehaviour diff --git a/Assets/Mirror/Components/LagCompensation/HistoryCollider.cs b/Assets/Mirror/Components/LagCompensation/HistoryCollider.cs index 8e841a411..876eb1842 100644 --- a/Assets/Mirror/Components/LagCompensation/HistoryCollider.cs +++ b/Assets/Mirror/Components/LagCompensation/HistoryCollider.cs @@ -4,6 +4,8 @@ namespace Mirror { + [DisallowMultipleComponent] + [AddComponentMenu("Network/ Lag Compensation/ History Collider")] public class HistoryCollider : MonoBehaviour { [Header("Components")] diff --git a/Assets/Mirror/Components/LagCompensation/LagCompensator.cs b/Assets/Mirror/Components/LagCompensation/LagCompensator.cs index c4f398c71..63669c0ed 100644 --- a/Assets/Mirror/Components/LagCompensation/LagCompensator.cs +++ b/Assets/Mirror/Components/LagCompensation/LagCompensator.cs @@ -35,6 +35,7 @@ public static Capture3D Interpolate(Capture3D from, Capture3D to, double t) => } [DisallowMultipleComponent] + [AddComponentMenu("Network/ Lag Compensation/ Lag Compensator")] [HelpURL("https://mirror-networking.gitbook.io/docs/manual/general/lag-compensation")] public class LagCompensator : NetworkBehaviour { diff --git a/Assets/Mirror/Components/NetworkDiagnosticsDebugger.cs b/Assets/Mirror/Components/NetworkDiagnosticsDebugger.cs index 021b791ff..d3c363278 100644 --- a/Assets/Mirror/Components/NetworkDiagnosticsDebugger.cs +++ b/Assets/Mirror/Components/NetworkDiagnosticsDebugger.cs @@ -2,6 +2,7 @@ namespace Mirror { + [AddComponentMenu("Network/Network Diagnostics Debugger")] public class NetworkDiagnosticsDebugger : MonoBehaviour { public bool logInMessages = true; diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs index 976a12cd4..ba17a7012 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable.cs @@ -3,6 +3,7 @@ namespace Mirror { // [RequireComponent(typeof(Rigidbody))] <- OnValidate ensures this is on .target + [AddComponentMenu("Network/Network Rigidbody (Reliable)")] public class NetworkRigidbodyReliable : NetworkTransformReliable { bool clientAuthority => syncDirection == SyncDirection.ClientToServer; diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs index 28fb42292..f17bab62e 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyReliable2D.cs @@ -3,6 +3,7 @@ namespace Mirror { // [RequireComponent(typeof(Rigidbody))] <- OnValidate ensures this is on .target + [AddComponentMenu("Network/Network Rigidbody 2D (Reliable)")] public class NetworkRigidbodyReliable2D : NetworkTransformReliable { bool clientAuthority => syncDirection == SyncDirection.ClientToServer; diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs index 7e823920e..6a347669e 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable.cs @@ -3,6 +3,7 @@ namespace Mirror { // [RequireComponent(typeof(Rigidbody))] <- OnValidate ensures this is on .target + [AddComponentMenu("Network/Network Rigidbody (Unreliable)")] public class NetworkRigidbodyUnreliable : NetworkTransformUnreliable { bool clientAuthority => syncDirection == SyncDirection.ClientToServer; diff --git a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs index 787fb9fdd..308ce0e70 100644 --- a/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs +++ b/Assets/Mirror/Components/NetworkRigidbody/NetworkRigidbodyUnreliable2D.cs @@ -3,6 +3,7 @@ namespace Mirror { // [RequireComponent(typeof(Rigidbody))] <- OnValidate ensures this is on .target + [AddComponentMenu("Network/Network Rigidbody 2D (Unreliable)")] public class NetworkRigidbodyUnreliable2D : NetworkTransformUnreliable { bool clientAuthority => syncDirection == SyncDirection.ClientToServer; diff --git a/Assets/Mirror/Examples/Basic/Scripts/Player.cs b/Assets/Mirror/Examples/Basic/Scripts/Player.cs index 0261fce84..c095be4d1 100644 --- a/Assets/Mirror/Examples/Basic/Scripts/Player.cs +++ b/Assets/Mirror/Examples/Basic/Scripts/Player.cs @@ -3,6 +3,7 @@ namespace Mirror.Examples.Basic { + [AddComponentMenu("")] public class Player : NetworkBehaviour { // Events that the PlayerUI will subscribe to diff --git a/Assets/Mirror/Examples/BenchmarkPrediction/NetworkManagerPredictionBenchmark.cs b/Assets/Mirror/Examples/BenchmarkPrediction/NetworkManagerPredictionBenchmark.cs index 7c995fd28..e969ee6ad 100644 --- a/Assets/Mirror/Examples/BenchmarkPrediction/NetworkManagerPredictionBenchmark.cs +++ b/Assets/Mirror/Examples/BenchmarkPrediction/NetworkManagerPredictionBenchmark.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.PredictionBenchmark { + [AddComponentMenu("")] public class NetworkManagerPredictionBenchmark : NetworkManager { [Header("Spawns")] diff --git a/Assets/Mirror/Examples/CharacterSelection/Scripts/NetworkManagerCharacterSelection.cs b/Assets/Mirror/Examples/CharacterSelection/Scripts/NetworkManagerCharacterSelection.cs index 85479cf36..3a9100709 100644 --- a/Assets/Mirror/Examples/CharacterSelection/Scripts/NetworkManagerCharacterSelection.cs +++ b/Assets/Mirror/Examples/CharacterSelection/Scripts/NetworkManagerCharacterSelection.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.CharacterSelection { + [AddComponentMenu("")] public class NetworkManagerCharacterSelection : NetworkManager { // See the scene 'SceneMapSpawnWithNoCharacter', to spawn as empty player. diff --git a/Assets/Mirror/Examples/Room/Scripts/PlayerCamera.cs b/Assets/Mirror/Examples/Room/Scripts/PlayerCamera.cs index 81f7e34d3..367c88379 100644 --- a/Assets/Mirror/Examples/Room/Scripts/PlayerCamera.cs +++ b/Assets/Mirror/Examples/Room/Scripts/PlayerCamera.cs @@ -5,6 +5,7 @@ namespace Mirror.Examples.NetworkRoom { + [AddComponentMenu("")] public class PlayerCamera : NetworkBehaviour { Camera mainCam; diff --git a/Assets/Mirror/Examples/Room/Scripts/PlayerController.cs b/Assets/Mirror/Examples/Room/Scripts/PlayerController.cs index c0ef8d51f..4d852d772 100644 --- a/Assets/Mirror/Examples/Room/Scripts/PlayerController.cs +++ b/Assets/Mirror/Examples/Room/Scripts/PlayerController.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.NetworkRoom { + [AddComponentMenu("")] [RequireComponent(typeof(CapsuleCollider))] [RequireComponent(typeof(CharacterController))] [RequireComponent(typeof(NetworkTransformReliable))] diff --git a/Assets/Mirror/Examples/Room/Scripts/PlayerScore.cs b/Assets/Mirror/Examples/Room/Scripts/PlayerScore.cs index 80afd78c5..64d10afce 100644 --- a/Assets/Mirror/Examples/Room/Scripts/PlayerScore.cs +++ b/Assets/Mirror/Examples/Room/Scripts/PlayerScore.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.NetworkRoom { + [AddComponentMenu("")] public class PlayerScore : NetworkBehaviour { [SyncVar] diff --git a/Assets/Mirror/Examples/Room/Scripts/Reward.cs b/Assets/Mirror/Examples/Room/Scripts/Reward.cs index ac2ced195..1e1fd9dcc 100644 --- a/Assets/Mirror/Examples/Room/Scripts/Reward.cs +++ b/Assets/Mirror/Examples/Room/Scripts/Reward.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.NetworkRoom { + [AddComponentMenu("")] [RequireComponent(typeof(Common.RandomColor))] public class Reward : NetworkBehaviour { diff --git a/Assets/Mirror/Examples/StackedPrediction/NetworkManagerStackedPrediction.cs b/Assets/Mirror/Examples/StackedPrediction/NetworkManagerStackedPrediction.cs index febe1631d..793c8e3c7 100644 --- a/Assets/Mirror/Examples/StackedPrediction/NetworkManagerStackedPrediction.cs +++ b/Assets/Mirror/Examples/StackedPrediction/NetworkManagerStackedPrediction.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.PredictionBenchmark { + [AddComponentMenu("")] public class NetworkManagerStackedPrediction : NetworkManager { [Header("Spawns")] diff --git a/Assets/Mirror/Examples/TankTheftAuto/Scripts/AuthorityNetworkManager.cs b/Assets/Mirror/Examples/TankTheftAuto/Scripts/AuthorityNetworkManager.cs index 5face5fda..16ad381e8 100644 --- a/Assets/Mirror/Examples/TankTheftAuto/Scripts/AuthorityNetworkManager.cs +++ b/Assets/Mirror/Examples/TankTheftAuto/Scripts/AuthorityNetworkManager.cs @@ -1,7 +1,9 @@ using System.Linq; +using UnityEngine; namespace Mirror.Examples.TankTheftAuto { + [AddComponentMenu("")] public class AuthorityNetworkManager : NetworkManager { /// diff --git a/Assets/Mirror/Examples/_Common/Scripts/CanvasNetworkManagerHUD/CanvasNetworkManagerHUD.cs b/Assets/Mirror/Examples/_Common/Scripts/CanvasNetworkManagerHUD/CanvasNetworkManagerHUD.cs index f85f78ec2..10f2e71cc 100755 --- a/Assets/Mirror/Examples/_Common/Scripts/CanvasNetworkManagerHUD/CanvasNetworkManagerHUD.cs +++ b/Assets/Mirror/Examples/_Common/Scripts/CanvasNetworkManagerHUD/CanvasNetworkManagerHUD.cs @@ -6,6 +6,7 @@ namespace Mirror.Examples.Common { + [AddComponentMenu("")] public class CanvasNetworkManagerHUD : MonoBehaviour { [SerializeField] private GameObject startButtonsGroup; diff --git a/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs b/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs index a571cef15..e90888138 100644 --- a/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs +++ b/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs @@ -2,6 +2,7 @@ namespace Mirror.Examples.Common { + [AddComponentMenu("Network/Network Random Color")] public class RandomColor : NetworkBehaviour { // Unity clones the material when GetComponent().material is called diff --git a/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs.meta b/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs.meta index 516f25598..8cb5c59d4 100644 --- a/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs.meta +++ b/Assets/Mirror/Examples/_Common/Scripts/RandomColor.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 7453abfe9e8b2c04a8a47eb536fe21eb, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Mirror/Tests/Common/NetworkBehaviourMock.cs b/Assets/Mirror/Tests/Common/NetworkBehaviourMock.cs index 3c1932033..a33a7b479 100644 --- a/Assets/Mirror/Tests/Common/NetworkBehaviourMock.cs +++ b/Assets/Mirror/Tests/Common/NetworkBehaviourMock.cs @@ -1,7 +1,10 @@ // simple network behaviour mock component which counts calls. // this is necessary for many tests. +using UnityEngine; + namespace Mirror.Tests { + [AddComponentMenu("")] public class NetworkBehaviourMock : NetworkBehaviour { // start diff --git a/Assets/Mirror/Tests/EditorBehaviours/AttributeNetworkBehaviour.cs b/Assets/Mirror/Tests/EditorBehaviours/AttributeNetworkBehaviour.cs index deb1e7f2b..e7c21e8ea 100644 --- a/Assets/Mirror/Tests/EditorBehaviours/AttributeNetworkBehaviour.cs +++ b/Assets/Mirror/Tests/EditorBehaviours/AttributeNetworkBehaviour.cs @@ -1,5 +1,8 @@ +using UnityEngine; + namespace Mirror.Tests.EditorBehaviours.Attributes { + [AddComponentMenu("")] public class AttributeBehaviour_NetworkBehaviour : NetworkBehaviour { public static readonly float Expected_float = 2020f; diff --git a/Assets/Mirror/Tests/EditorBehaviours/NetworkIdentityTests_Common.cs b/Assets/Mirror/Tests/EditorBehaviours/NetworkIdentityTests_Common.cs index 617bc12e9..da6eb8965 100644 --- a/Assets/Mirror/Tests/EditorBehaviours/NetworkIdentityTests_Common.cs +++ b/Assets/Mirror/Tests/EditorBehaviours/NetworkIdentityTests_Common.cs @@ -1,7 +1,9 @@ using System; +using UnityEngine; namespace Mirror.Tests.EditorBehaviours.NetworkIdentities { + [AddComponentMenu("")] public class StartServerExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -12,6 +14,7 @@ public override void OnStartServer() } } + [AddComponentMenu("")] public class StartClientExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -22,6 +25,7 @@ public override void OnStartClient() } } + [AddComponentMenu("")] public class StartAuthorityExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -32,6 +36,7 @@ public override void OnStartAuthority() } } + [AddComponentMenu("")] public class StopAuthorityExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -42,6 +47,7 @@ public override void OnStopAuthority() } } + [AddComponentMenu("")] public class StartLocalPlayerExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -52,6 +58,7 @@ public override void OnStartLocalPlayer() } } + [AddComponentMenu("")] public class StopClientExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -62,6 +69,7 @@ public override void OnStopClient() } } + [AddComponentMenu("")] public class StopLocalPlayerExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -72,6 +80,7 @@ public override void OnStopLocalPlayer() } } + [AddComponentMenu("")] public class StopServerExceptionNetworkBehaviour : NetworkBehaviour { public int called; @@ -82,6 +91,7 @@ public override void OnStopServer() } } + [AddComponentMenu("")] public class SerializeTest1NetworkBehaviour : NetworkBehaviour { public int value; @@ -95,6 +105,7 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + [AddComponentMenu("")] public class SerializeTest2NetworkBehaviour : NetworkBehaviour { public string value; @@ -108,6 +119,7 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + [AddComponentMenu("")] public class SyncVarTest1NetworkBehaviour : NetworkBehaviour { [SyncVar] public int value; @@ -117,11 +129,13 @@ public class SyncVarTest1NetworkBehaviour : NetworkBehaviour public void SetValue(int n) => value = n; } + [AddComponentMenu("")] public class SyncVarTest2NetworkBehaviour : NetworkBehaviour { [SyncVar] public string value; } + [AddComponentMenu("")] public class SerializeExceptionNetworkBehaviour : NetworkBehaviour { public override void OnSerialize(NetworkWriter writer, bool initialState) @@ -134,6 +148,7 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + [AddComponentMenu("")] public class SerializeMismatchNetworkBehaviour : NetworkBehaviour { public int value; @@ -149,6 +164,7 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + [AddComponentMenu("")] public class IsClientServerCheckComponent : NetworkBehaviour { // OnStartClient