Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ritamerkl committed Jan 7, 2025
1 parent cf2863a commit 16f46df
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ namespace UnityEngine.InputSystem.Editor
/// <summary>
/// This class controls all required plugins and extension packages are installed for the InputSystem.
/// </summary>
/// <remarks>
/// For some platforms, the InputSystem requires additional plugins to be installed. This class checks if the required plugins are installed and throws a warning if they are not.
/// </remarks>
public class InputSystemPluginControl
{
//At the time of InitializeOnLoad the packages are compiled and registered
[InitializeOnLoadMethod]
private static void CheckForExtension()
{
ThrowWarningOnMissingPlugin();
m_pluginPackageRegistered = false;
}

private static readonly BuildTarget[] TargetNoPluginNeeded =
Expand Down Expand Up @@ -62,14 +66,17 @@ static bool BuildTargetNeedsPlugin()
/// <summary>
/// Used to register extensions externally to the InputSystem, this is needed for all Platforms that require a plugin to be installed.
/// </summary>
/// <remarks>
/// This method is internally called by the InputSystem package extensions to register the PlugIn. This can be called for custom extensions on custom platforms.
/// </remarks>
public static void RegisterPluginPackage()
{
m_pluginPackageRegistered = true;
}

private static bool IsPluginInstalled()
{
if (!m_pluginPackageRegistered)
if (m_pluginPackageRegistered)
return true;
var registeredPackages = UnityEditor.PackageManager.PackageInfo.GetAllRegisteredPackages();
var plugInName = PlugInName + EditorUserBuildSettings.activeBuildTarget.ToString().ToLower();
Expand Down

0 comments on commit 16f46df

Please sign in to comment.