How to implement Windows Phone code to communicate with unity (call directly)

Source: Internet
Author: User
Tags exit in

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.