EngineAdditions.cs

Adds an interface IDefinitionResource with Title and Description properties, and an extension on GameObject providing FindNetworkRoot which walks up parent chain to find the first object with NetworkMode == Object or returns null if invalid.

Networking
namespace Sandbox;

public interface IDefinitionResource
{
	public string Title { get; set; }
	public string Description { get; set; }
}

public static class EngineAdditions
{
	extension( GameObject go )
	{
		public GameObject FindNetworkRoot()
		{
			if ( !go.IsValid() ) return null;

			if ( go.NetworkMode == NetworkMode.Object ) return go;
			return go.Parent?.FindNetworkRoot();
		}
	}
}