I used two articles written in WP and unity to communicate with each other, the method of invocation, one is an event, one is a plug-in.
This is a simpler one, and I think this should be a unique advantage of Unity's release to WP or WIN store. After all, they are C #.
Too lazy to write so detailed.
Specifically in unity inside the definition of a public static method, in WP directly can be called, hehe, and so on.
This is usually the case when you save the data.
Because the exit in WP may be in multi-task management, the direct slide, so that the exit will not trigger unity Onapplicationquit. If you write the method of saving data in this event, then all right, the user's data is not saved and then exited.
Of course you can use Unity's onapplicationfocus or onapplicationpause. But I did have a situation where there was no trigger. And these two methods have more than egg pain I am too lazy to say (actually pause and restore will call, need to write their own flag bit to judge Ah, Fall!) )。
So for example, you write a global save method in unity. Global.savegamedata, you can be in WP App.xaml.cn in the application_deactivated and application_closing called.
This is convenient.
You might actually find out. The first two events, plug-ins are the way Unity calls WP (direct or indirect). This time, this is the way WP calls unity. This is the perfect thing.
The class that unity encapsulates for Wp/win Store calls is actually quite handy. To be more dramatic, you don't even have to write any line of code in unity, and all the operations are done in the Wp/win store with the logic of the game (of course, only the idiots do).
How to implement Windows Phone code to communicate with unity (call directly)