File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed 
Packages/com.unity.inputsystem/InputSystem/Editor Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 55
66namespace  UnityEngine . InputSystem . Editor 
77{ 
8-     internal  class  InputSystemPluginControl 
8+     /// <summary> 
9+     /// This class controls all required plugins and extension packages are installed for the InputSystem. 
10+     /// </summary> 
11+     public  class  InputSystemPluginControl 
912    { 
1013        //At the time of InitializeOnLoad the packages are compiled and registered 
1114        [ InitializeOnLoadMethod ] 
@@ -42,6 +45,8 @@ private static void CheckForExtension()
4245            BuildTarget . NoTarget 
4346        } ; 
4447
48+         private  static   bool  m_pluginPackageRegistered  =  false ; 
49+ 
4550        static   bool  BuildTargetNeedsPlugin ( ) 
4651        { 
4752            BuildTarget  target  =  EditorUserBuildSettings . activeBuildTarget ; 
@@ -54,12 +59,23 @@ static bool BuildTargetNeedsPlugin()
5459
5560        private  const  string  PlugInName  =  "com.unity.inputsystem." ; 
5661
62+         /// <summary> 
63+         /// Used to register extensions externally to the InputSystem, this is needed for all Platforms that require a plugin to be installed. 
64+         /// </summary> 
65+         public  static   void  RegisterPluginPackage ( ) 
66+         { 
67+             m_pluginPackageRegistered  =  true ; 
68+         } 
69+ 
5770        private  static   bool  IsPluginInstalled ( ) 
5871        { 
72+             if  ( ! m_pluginPackageRegistered ) 
73+                 return  true ; 
5974            var  registeredPackages  =  UnityEditor . PackageManager . PackageInfo . GetAllRegisteredPackages ( ) ; 
75+             var  plugInName  =  PlugInName  +  EditorUserBuildSettings . activeBuildTarget . ToString ( ) . ToLower ( ) ; 
6076            foreach  ( var  package  in  registeredPackages ) 
6177            { 
62-                 if  ( package . name . StartsWith ( PlugInName ) ) 
78+                 if  ( package . name . Equals ( plugInName ) ) 
6379                    return  true ; 
6480            } 
6581            return  false ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments