Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

WP8 plugins folder

Discussion in 'Windows' started by Ostwind, Jul 26, 2013.

  1. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Is this folder supported and how its hierarchy is supposed to be (so references are added to vsproj)?

    Plugins/WP8
    Plugins/WP8/(ARM or x86?)

    I know I cant probably use the code inside editor since its running mono but how should I get the code to work on the device at least and so that the editor doesn't fail to compiler errors due plugins

    #if !UNITY_EDITOR UNITY_WP8
    xx
    #else
    yy
    #endif

    Docs don't seem to have any info about the new platforms :)
     
  2. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    883
    What you can do is create two plugins. One for the editor, and one for WP8. The editor one should just contain empty functions (or you can implement them to work in the editor) that match up to all the functions in the WP8 plugin. They should be named exactly the same, then you put one .dll into the Plugins/ folder, and the WP8 one into the Plugins/WP8/ folder.

    That way, in the editor you can call the functions (and use the Editor plugin), but when you build it will replace the editor plugin with your plugin of the same name in the Plugins/WP8 directory.

    -Kyle
     
  3. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Yeah thats a good way however there is another problem or maybe a bug with Unity. I have plugins (such as mono sqlite) under Android and iOS folders and they get referenced in the WP8 VS projects (editor+build) which makes it all fail. I cant figure out a way to get my WP8 to compile unless I delete or rename those plugin folders.
     
  4. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    883
    Thats right - all plugins will be included in the build, so if you have plugins used by others that do not support Windows 8 / WP8, then they will throw errors. You have three options:

    1. Try to get an update from the developer with supported API's being used.
    2. Remove them from your project, or into a "PluginsNotInBuild" folder when building for Windows 8 / WP8
    3. Create a dummy plugin of the same name and place it in the Plugins/WP8 folder. This will overwrite the other plugin when building to WP8.
     
  5. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    It should not work like that as each platform has its own plugins and folders so it should not care or even see what they use. It's really messy if we have to move or rename files when switching between platforms in order to make builds as it will also mess the version system. Maybe the problem existed before too but was not noticeable as all platforms used same mono version with pretty much same features. Now WP8/Metro have its own and rest use mono so there are lot of conflicts depending what plugins are in use (inhouse and 3rd party).

    Main problem is that I could not even get it to compile even after adding compiler defines everywhere because it was checking the validity of iOS and Android plugin folder stuff which use a lot of stuff that WP8 ain't supporting. Ill see how well I get this working and if not I might submit a bugreport unless Tomas or Tautvydas has more info about this ;)

    Gotta try the dummy thing and see if it helps as I don't need or want to support same features on WP8. Thanks for the tips :)