Skip to content

Commit 8c964aa

Browse files
authored
fix: Add help urls to all components in the component menu (#3663)
## Purpose of this PR Adds help urls to all components that are added to the component menu. This ensures the question mark icon in the inspector view will redirect to a valid page. ### Jira ticket [MTTB-1452](https://jira.unity3d.com/browse/MTTB-1452) ### Changelog - Added: Help URLs ensure the inspector redirects to valid web pages. ## Documentation - No documentation changes or additions were necessary. ## Testing & QA (How your changes can be verified during release Playtest) [//]: # ( This section is REQUIRED and should describe how the changes were tested and how should they be tested when Playtesting for the release. It can range from "edge case covered by unit tests" to "manual testing required and new sample was added". Expectation is that PR creator does some manual testing and provides a summary of it here.) <!-- Add any performance testing results here if relevant. --> ### Functional Testing [//]: # (If checked, List manual tests that have been performed.) _Manual testing :_ - [x] `Manual testing done` _Automated tests:_ - [ ] `Covered by existing automated tests` - [x] `Covered by new automated tests` _Does the change require QA team to:_ - [ ] `Review automated tests`? - [ ] `Execute manual tests`? - [ ] `Provide feedback about the PR`? If any boxes above are checked the QA team will be automatically added as a PR reviewer. ## Backports Backported by #3676
1 parent c63202f commit 8c964aa

16 files changed

+218
-0
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1010

1111
### Added
1212

13+
- Clicking on the Help icon in the inspector will now redirect to the relevant documentation. (#3663)
1314

1415
### Changed
1516

com.unity.netcode.gameobjects/Runtime/Components/AnticipatedNetworkTransform.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Unity.Mathematics;
2+
using Unity.Netcode.Runtime;
23
using UnityEngine;
34

45
namespace Unity.Netcode.Components
@@ -43,6 +44,7 @@ namespace Unity.Netcode.Components
4344
#pragma warning restore IDE0001
4445
[DisallowMultipleComponent]
4546
[AddComponentMenu("Netcode/Anticipated Network Transform")]
47+
[HelpURL(HelpUrls.AnticipatedNetworkTransform)]
4648
public class AnticipatedNetworkTransform : NetworkTransform
4749
{
4850

com.unity.netcode.gameobjects/Runtime/Components/NetworkAnimator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections.Generic;
44
using Unity.Collections;
55
using Unity.Collections.LowLevel.Unsafe;
6+
using Unity.Netcode.Runtime;
67
using UnityEngine;
78
#if UNITY_EDITOR
89
using UnityEditor.Animations;
@@ -186,6 +187,7 @@ internal NetworkAnimatorStateChangeHandler(NetworkAnimator networkAnimator)
186187
/// NetworkAnimator enables remote synchronization of <see cref="UnityEngine.Animator"/> state for on network objects.
187188
/// </summary>
188189
[AddComponentMenu("Netcode/Network Animator")]
190+
[HelpURL(HelpUrls.NetworkAnimator)]
189191
public class NetworkAnimator : NetworkBehaviour, ISerializationCallbackReceiver
190192
{
191193
[Serializable]

com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidbody.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if COM_UNITY_MODULES_PHYSICS
2+
using Unity.Netcode.Runtime;
23
using UnityEngine;
34

45
namespace Unity.Netcode.Components
@@ -10,6 +11,7 @@ namespace Unity.Netcode.Components
1011
[RequireComponent(typeof(NetworkTransform))]
1112
[RequireComponent(typeof(Rigidbody))]
1213
[AddComponentMenu("Netcode/Network Rigidbody")]
14+
[HelpURL(HelpUrls.NetworkRigidbody)]
1315
public class NetworkRigidbody : NetworkRigidbodyBase
1416
{
1517

com.unity.netcode.gameobjects/Runtime/Components/NetworkRigidbody2D.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if COM_UNITY_MODULES_PHYSICS2D
2+
using Unity.Netcode.Runtime;
23
using UnityEngine;
34

45
namespace Unity.Netcode.Components
@@ -10,6 +11,7 @@ namespace Unity.Netcode.Components
1011
[RequireComponent(typeof(NetworkTransform))]
1112
[RequireComponent(typeof(Rigidbody2D))]
1213
[AddComponentMenu("Netcode/Network Rigidbody 2D")]
14+
[HelpURL(HelpUrls.NetworkRigidbody2D)]
1315
public class NetworkRigidbody2D : NetworkRigidbodyBase
1416
{
1517
public Rigidbody2D Rigidbody2D => m_InternalRigidbody2D;

com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Runtime.CompilerServices;
44
using System.Text;
55
using Unity.Mathematics;
6+
using Unity.Netcode.Runtime;
67
using UnityEngine;
78

89
namespace Unity.Netcode.Components
@@ -14,6 +15,7 @@ namespace Unity.Netcode.Components
1415
/// </summary>
1516
[DisallowMultipleComponent]
1617
[AddComponentMenu("Netcode/Network Transform")]
18+
[HelpURL(HelpUrls.NetworkTransform)]
1719
public class NetworkTransform : NetworkBehaviour
1820
{
1921
#if UNITY_EDITOR

com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using Unity.Collections;
44
using Unity.Jobs;
5+
using Unity.Netcode.Runtime;
56
using UnityEngine;
67

78
namespace Unity.Netcode.Components
@@ -71,6 +72,7 @@ public interface IContactEventHandlerWithInfo : IContactEventHandler
7172
/// <see cref="ContactEventHandlerInfo"/><br />
7273
/// </summary>
7374
[AddComponentMenu("Netcode/Rigidbody Contact Event Manager")]
75+
[HelpURL(HelpUrls.RigidbodyContactEventManager)]
7476
public class RigidbodyContactEventManager : MonoBehaviour
7577
{
7678
public static RigidbodyContactEventManager Instance { get; private set; }

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
using UnityEngine.SceneManagement;
1111
using Debug = UnityEngine.Debug;
1212
using Unity.Netcode.Components;
13+
using Unity.Netcode.Runtime;
1314

1415
namespace Unity.Netcode
1516
{
1617
/// <summary>
1718
/// The main component of the library
1819
/// </summary>
1920
[AddComponentMenu("Netcode/Network Manager", -100)]
21+
[HelpURL(HelpUrls.NetworkManager)]
2022
public class NetworkManager : MonoBehaviour, INetworkUpdateSystem
2123
{
2224
/// <summary>

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Runtime.CompilerServices;
55
using System.Text;
66
using Unity.Netcode.Components;
7+
using Unity.Netcode.Runtime;
78
#if UNITY_EDITOR
89
using UnityEditor;
910
#if UNITY_2021_2_OR_NEWER
@@ -24,6 +25,7 @@ namespace Unity.Netcode
2425
/// </summary>
2526
[AddComponentMenu("Netcode/Network Object", -99)]
2627
[DisallowMultipleComponent]
28+
[HelpURL(HelpUrls.NetworkObject)]
2729
public sealed class NetworkObject : MonoBehaviour
2830
{
2931
[HideInInspector]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace Unity.Netcode.Runtime
2+
{
3+
internal static class HelpUrls
4+
{
5+
private const string k_BaseUrl = "https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest/?subfolder=/";
6+
private const string k_BaseManualUrl = k_BaseUrl + "manual/";
7+
private const string k_BaseApiUrl = k_BaseUrl + "api/Unity.Netcode";
8+
9+
// The HelpUrls have to be defined as public for the test to work
10+
public const string NetworkManager = k_BaseManualUrl + "components/core/networkmanager.html";
11+
public const string NetworkObject = k_BaseManualUrl + "components/core/networkobject.html";
12+
public const string NetworkAnimator = k_BaseManualUrl + "components/helper/networkanimator.html";
13+
public const string NetworkRigidbody = k_BaseManualUrl + "advanced-topics/physics.html#networkrigidbody";
14+
public const string NetworkRigidbody2D = k_BaseManualUrl + "advanced-topics/physics.html#networkrigidbody2d";
15+
public const string RigidbodyContactEventManager = k_BaseApiUrl + ".Components.RigidbodyContactEventManager.html";
16+
public const string NetworkTransform = k_BaseManualUrl + "components/helper/networktransform.html";
17+
public const string AnticipatedNetworkTransform = k_BaseManualUrl + "advanced-topics/client-anticipation.html";
18+
public const string UnityTransport = k_BaseApiUrl + ".Transports.UTP.UnityTransport.html";
19+
public const string SecretsLoaderHelper = k_BaseApiUrl + ".Transports.UTP.SecretsLoaderHelper.html";
20+
public const string SinglePlayerTransport = k_BaseApiUrl + ".Transports.SinglePlayer.SinglePlayerTransport.html";
21+
}
22+
}

0 commit comments

Comments
 (0)