简体   繁体   English

在Unity 5.0中创建Wp8 Unity插件

[英]Creating Wp8 Unity Plugin in Unity 5.0

I have a windows phone 8.0 plugin created for an app. 我有一个为应用程序创建的Windows Phone 8.0插件。 This app worked perfectly fine in Unity 4.5. 这个应用程序在Unity 4.5中运行得非常好。 I recently updated my Unity to 5.0. 我最近将Unity更新为5.0。 I also saw all the needed alterations. 我也看到了所有需要的改动。 Initially, we needed to create two plugin dlls. 最初,我们需要创建两个插件dll。 One actual and one empty simply like an interface for the editor. 一个实际的和一个空的,就像编辑器的界面一样。 This went pretty well in unity 4.5 Now i open the same app in Unity 5.0 by upgrading it. 这在团结中非常顺利4.5现在我通过升级它在Unity 5.0中打开相同的应用程序。 and i am unable to build it for wp8 anymore. 而我无法再为wp8构建它了。 I set the inspector platforms correctly to WP8 player for my plugin dll. 我将检查器平台正确设置为我的插件dll的WP8播放器。 But, i keep getting errors like :: 但是,我不断收到像::

1. Plugins are colliding. 插件正在碰撞。

2. There are errors in the script (which are actually not) 2.脚本中有错误(实际上并非如此)

3. Cannot load classes from module. 3.无法从模块加载类。

4.System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. 4.System.Reflection.ReflectionTypeLoadException:无法加载模块中的类。 etc. 等等

Can anybody help me? 有谁能够帮助我? I have tried several things already but none seems to work. 我已经尝试了几件事,但似乎都没有效果。 I tried : 我试过了 :

1. Reimporting everything 1.重新进口一切

2. Rebuilding the dlls. 2.重建dll。

3. Removing the empty interfaced dll for editor 3.删除编辑器的空接口dll

4. Changing the folder structure for plugins. 4.更改插件的文件夹结构。 (Default being Assets/Plugins/WP8) (默认为Assets / Plugins / WP8)

I am stuck here since two days now. 我被困在这里两天了。

Well, it's too late to reply. 那么,回复已经太晚了。 But anybody else stuck in same problem may get help. 但是遇到同样问题的其他人可能会得到帮助。

One should know that WP8 Plugins are based on real and fake dlls in order to work in Unity Editor. 应该知道WP8插件基于真实和假dll,以便在Unity Editor中工作。

In Unity 5, you can specify platform to dll, irrespective of folder structures. 在Unity 5中,您可以将平台指定为dll,而不管文件夹结构如何。 However if you put dll in Assets->Plugins->WP8 . 但是如果你把dll放在Assets-> Plugins-> WP8中 Unity will mark it as WP8 dll. Unity会将其标记为WP8 dll。

Solution is, 1- Put Fake dll in Assets->Plugins->AnyFolder->plugin.dll , where any AnyFolder is other than WP8 folder. 解决方案是,1-在假设 - >插件 - > AnyFolder-> plugin.dll中放置 dll,其中任何AnyFolder不是WP8文件夹。 Mark it as Editor instead of Any Platform (from inspector [Select platform for plugins]). 将其标记为编辑器而不是任何平台(来自检查器[Select plug for plugins])。

2- Put Original dll in Assets->Plugins->WP8->plugin.dll , mark it as WP8Player 2-将原始 dll放入Assets-> Plugins-> WP8-> plugin.dll ,将其标记为WP8Player

3- Keeping original dll selected, in Platfrom Settings [Inspector] modify settings like, CPU -> Any CPU , check mark on Don't Process , Select placeholder. 3-保持选择原始dll,在Platfrom设置[Inspector]中修改设置,如CPU - > 任何CPU ,勾选“不处理” ,选择占位符。

Placeholder drop down would show the path of fake dll, just set it. 占位符下拉列表将显示假dll的路径,只需设置它。

Now you are all done :) 现在你们都完成了:)

您必须将编辑器DLL设置为“Editor”而不是“Any Platform”,并将WP8插件设置为插件设置中的“WP8Player”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM