Search Unity

Question Plugin inspector for packages - read only

Discussion in 'Editor & General Support' started by eusebium, Nov 5, 2020.

  1. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Hello,
    Sometimes the plugins within the packages are not considering all the platforms and I would like to exclude them for specific platforms - they are read-only.
    E.g. https://github.com/ValveSoftware/unity-xr-plugin/issues/60

    Is is possible to do that from within the Editor? (like an option to enable the plugin inspector for packages)
    Currently, I manually edit the meta files but in Unity 2020 it refreshes the packages and overrides the manual change.
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hello @eusebium,

    You can do it by placing the resources that you want to manage inside of an assembly.

    You can find more information about how to use assemblies here: https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html

    For your specific purpose of excluding/including specific platforms, you should read the "Creating a platform-specific assembly" section of the mentioned Manual's web page.


    I hope this helps!
     
  3. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    The Create button is also disabled for packages - nothing can be created there.
    It seems like a limitation within the Editor.
     
  4. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hi @eusebium,

    Would you mind sharing a screenshot of the disabled Create button?

    It will help us to understand what you're referring to, with more precision.

    On the other hand... It's not using assemblies enough for your purposes of excluding plugins?

    Please let us know.


    Thank you!
     
  5. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    upload_2020-11-9_9-45-47.png

    And this is for the dll:
    upload_2020-11-9_9-46-26.png
     
  6. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Thank you for the screenshots.

    From what I see you're trying to use the OpenVR package, but support for such a package was removed in Unity 2020.1 (as you can see here: https://docs.unity3d.com/Packages/com.unity.xr.openvr.standalone@2.0/manual/index.html) and you're using Unity 2020.

    So you should downgrade your Unity project to an earlier version with support for that specific package or you should remove it from your project.


    Good luck with it!
     
  7. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Well, that plugin is OpenVR XR SDK that integrates with the new XR SDK Plugin Management, not the standalone one (XR legacy).
    The plugin/package is not important. The plugin inspector is readonly - that is the problem.

    Actually, there are two problems:
    1. the Plugin inspector for dlls in packages is readonly
    2. the Editor automatically (or at least on some rules) decides to refresh the content of the packages, thus overriding the changes performed locally (either manually or by allowing/fixing point 1).
     
  8. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Okay, let's try to go one step at a time.

    Can you try to create a new empty project and add one of the packages that are giving you troubles to see if their dll's are still readonly?

    If you found that's the case... Can you tell me which one you tried and in which Unity version you're using?


    Thanks!
     
  9. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    Try with Unity 2020.1.9f1 and with Custom NUnit - nunit.framework.dll
     
  10. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Thank you for the extra information!

    The problem that you're more likely having is that you want to edit the assembly definition file of a plugin/assembly that is inside of the
    Library/PackageCache
    folder.

    You can't do it, because your changes will be definitely overridden once the cache is recreated.

    If you really want to make the respective plugins/assemblies editable, you should move the complete folder from
    Library/PackageCache
    folder to the
    Packages
    and then edit the respective entry on the
    manifest.json
    file accordingly.

    For example, if you want to edit the
    Custom NUnit
    plugin, by changing the options of the
    nunit.framework
    file in the Inspector window, you should:
    1. Move the
      com.unity.ext.nunit@1.0.0
      folder from
      Library/PackageCache
      to
      Packages
    2. Edit the
      Packages/manisfest.json
      file, including the
      "com.unity.ext.nunit": "file:./com.unity.ext.nunit@1.0.0"
      entry inside the
      "dependencies"
      section
    3. Voilà!
    Good luck with it!
     
  11. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
    I'll give it a try the OpenVR plugin.

    Regarding changes being overridden once the cache being recreated - I am fine with that as long as I can control the recreation time - e.g. I am manually updating that package.
     
  12. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    I hope you can do it without further obstacles.

    Regarding making changes to the cached assets, the problem is that you shouldn't rely on the perseverance of content inside of any cache file or folder, because their content is supposed to not be changed at all unless you change the original asset (in this case the package itself on the Unity servers), otherwise you're "converting" a cached asset into an "instance" of the original and therefore it stops to be a cached file or folder.

    Please bear in mind that the content of the cache is just created and stored for convenience, but should be a temporary reflection or representation of the assets used for its creation.

    I hope this explanation helps to make things a little bit clearer.


    Good luck with your project!