Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Unity.Mathematics;
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Components
Expand Down Expand Up @@ -43,6 +44,7 @@ namespace Unity.Netcode.Components
#pragma warning restore IDE0001
[DisallowMultipleComponent]
[AddComponentMenu("Netcode/Anticipated Network Transform")]
[HelpURL(HelpUrls.AnticipatedNetworkTransform)]
public class AnticipatedNetworkTransform : NetworkTransform
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Netcode.Runtime;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor.Animations;
Expand Down Expand Up @@ -186,6 +187,7 @@ internal NetworkAnimatorStateChangeHandler(NetworkAnimator networkAnimator)
/// NetworkAnimator enables remote synchronization of <see cref="UnityEngine.Animator"/> state for on network objects.
/// </summary>
[AddComponentMenu("Netcode/Network Animator")]
[HelpURL(HelpUrls.NetworkAnimator)]
public class NetworkAnimator : NetworkBehaviour, ISerializationCallbackReceiver
{
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if COM_UNITY_MODULES_PHYSICS
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Components
Expand All @@ -10,6 +11,7 @@ namespace Unity.Netcode.Components
[RequireComponent(typeof(NetworkTransform))]
[RequireComponent(typeof(Rigidbody))]
[AddComponentMenu("Netcode/Network Rigidbody")]
[HelpURL(HelpUrls.NetworkRigidbody)]
public class NetworkRigidbody : NetworkRigidbodyBase
{

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if COM_UNITY_MODULES_PHYSICS2D
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Components
Expand All @@ -10,6 +11,7 @@ namespace Unity.Netcode.Components
[RequireComponent(typeof(NetworkTransform))]
[RequireComponent(typeof(Rigidbody2D))]
[AddComponentMenu("Netcode/Network Rigidbody 2D")]
[HelpURL(HelpUrls.NetworkRigidbody2D)]
public class NetworkRigidbody2D : NetworkRigidbodyBase
{
public Rigidbody2D Rigidbody2D => m_InternalRigidbody2D;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using Unity.Mathematics;
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Components
Expand All @@ -14,6 +15,7 @@ namespace Unity.Netcode.Components
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("Netcode/Network Transform")]
[HelpURL(HelpUrls.NetworkTransform)]
public class NetworkTransform : NetworkBehaviour
{
#if UNITY_EDITOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using Unity.Collections;
using Unity.Jobs;
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Components
Expand Down Expand Up @@ -71,6 +72,7 @@ public interface IContactEventHandlerWithInfo : IContactEventHandler
/// <see cref="ContactEventHandlerInfo"/><br />
/// </summary>
[AddComponentMenu("Netcode/Rigidbody Contact Event Manager")]
[HelpURL(HelpUrls.RigidbodyContactEventManager)]
public class RigidbodyContactEventManager : MonoBehaviour
{
public static RigidbodyContactEventManager Instance { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
using UnityEngine.SceneManagement;
using Debug = UnityEngine.Debug;
using Unity.Netcode.Components;
using Unity.Netcode.Runtime;

namespace Unity.Netcode
{
/// <summary>
/// The main component of the library
/// </summary>
[AddComponentMenu("Netcode/Network Manager", -100)]
[HelpURL(HelpUrls.NetworkManager)]
public class NetworkManager : MonoBehaviour, INetworkUpdateSystem
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using Unity.Netcode.Components;
using Unity.Netcode.Runtime;
#if UNITY_EDITOR
using UnityEditor;
#if UNITY_2021_2_OR_NEWER
Expand All @@ -24,6 +25,7 @@ namespace Unity.Netcode
/// </summary>
[AddComponentMenu("Netcode/Network Object", -99)]
[DisallowMultipleComponent]
[HelpURL(HelpUrls.NetworkObject)]
public sealed class NetworkObject : MonoBehaviour
{
[HideInInspector]
Expand Down
21 changes: 21 additions & 0 deletions com.unity.netcode.gameobjects/Runtime/HelpURL.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Unity.Netcode.Runtime
{
internal static class HelpUrls
{
private const string k_BaseUrl = "https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@latest/?subfolder=/";
private const string k_BaseManualUrl = k_BaseUrl + "manual/";
private const string k_BaseApiUrl = k_BaseUrl + "api/Unity.Netcode";

internal const string NetworkManager = k_BaseManualUrl + "components/core/networkmanager.html";
internal const string NetworkObject = k_BaseManualUrl + "components/core/networkobject.html";
internal const string NetworkAnimator = k_BaseManualUrl + "components/helper/networkanimator.html";
internal const string NetworkRigidbody = k_BaseManualUrl + "advanced-topics/physics.html#networkrigidbody";
internal const string NetworkRigidbody2D = k_BaseManualUrl + "advanced-topics/physics.html#networkrigidbody2d";
internal const string RigidbodyContactEventManager = k_BaseApiUrl + ".Components.RigidbodyContactEventManager.html";
internal const string NetworkTransform = k_BaseManualUrl + "components/helper/networktransform.html";
internal const string AnticipatedNetworkTransform = k_BaseManualUrl + "advanced-topics/client-anticipation.html";
internal const string UnityTransport = k_BaseApiUrl + ".Transports.UTP.UnityTransport.html";
internal const string SecretsLoaderHelper = k_BaseManualUrl + ".Transports.UTP.SecretsLoaderHelper.html";
internal const string SinglePlayerTransport = k_BaseApiUrl + ".Transports.SinglePlayer.SinglePlayerTransport.html";
}
}
3 changes: 3 additions & 0 deletions com.unity.netcode.gameobjects/Runtime/HelpURL.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
using Unity.Netcode.Runtime;
using UnityEditor;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards is complaining that UnityEditor is unnecessary here

using UnityEngine;

namespace Unity.Netcode.Transports.SinglePlayer
{
Expand All @@ -11,6 +14,8 @@ namespace Unity.Netcode.Transports.SinglePlayer
/// <remarks>
/// You can only start as a host when using this transport.
/// </remarks>
[AddComponentMenu("Netcode/Single Player Transport")]
[HelpURL(HelpUrls.SinglePlayerTransport)]
public class SinglePlayerTransport : NetworkTransport
{
/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;
using Unity.Netcode.Runtime;
using UnityEngine;

namespace Unity.Netcode.Transports.UTP
Expand All @@ -13,6 +14,7 @@ namespace Unity.Netcode.Transports.UTP
/// - SetClientSecrets
/// directly, instead of relying on this.
/// </summary>
[HelpURL(HelpUrls.SecretsLoaderHelper)]
public class SecretsLoaderHelper : MonoBehaviour
{
internal struct ServerSecrets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Netcode.Runtime;
using Unity.Networking.Transport;
using Unity.Networking.Transport.Relay;
using Unity.Networking.Transport.TLS;
Expand All @@ -28,6 +29,7 @@ namespace Unity.Netcode.Transports.UTP
/// Note: This is highly recommended to use over UNet.
/// </summary>
[AddComponentMenu("Netcode/Unity Transport")]
[HelpURL(HelpUrls.UnityTransport)]
public partial class UnityTransport : NetworkTransport, INetworkStreamDriverConstructor
{
/// <summary>
Expand Down