Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading