felixrieseberg / WinBridge

Native WinRT Controls & Features for Unity3D
Other
14 stars 4 forks source link

WinBridge: WinRT Controls & Features for Unity3D

The WinBridge is a plugin for Unity3D that enables easier command of native controls and features of WinRT (the underlying library behind Windows Store, Windows Phone and Xbox One apps). Currently implemented:

Installation

Copy the contents of the folder CopyContentsToUnityAssets into your Unity project.

Usage

Windows Store

This class manages full interaction with the Windows Store. To enable the functionality of all these methods during debug mode, please see the next point (Windows Store Proxy). Please note that most of these functions do result in an error if the app hasn't been published yet and debug settings aren't set properly.

Purchasing full version of the app

WinBridge.PurchaseFullApp(WinControls.Store.PurchaseResultHandler handler)

Checking if a valid license is present

WinBridge.IsFullAppActive()

Getting full app informtion reciept

WinBridge.GetFullAppInfo(WinControls.Store.FullAppInfoHandler handler)

Purchasing a product (In-App-Purchase)

WinBridge.PurchaseProduct(string productId, WinControls.Store.PurchaseResultHandler handler)

Getting product information (name, price, description) (In-App-Purchase)

WinBridge.GetProductInfo(string productId, WinControls.Store.ProductInfoHandler handler)

Requesting a review of the app

WinBridge.RequestReview(string label, string okLabel, string cancelLabel)

Windows Store Proxy

A Windows Store Proxy can be attached to any GameObject with Add Component - WinBridge - Windows Store Proxy. The inspector editor is fairly self-explanatory - for questions around the purpose of individual fields, please consult the official Windows Store documentation on MSDN .

If you know what you're doing, hate convenience and you feel like providing a full WindowsStoreProxy.xml straight to the plugin, call:

WinControls.Store.EnableDebugWindowsStoreProxy(string WindowsStoreProxyXML);

Message Box

The MessageBox can be added to any GameObject with Add Component - WinBridge - MessageBox. Simply make all your settings in the inspector window. To invoke the message box, call Show() on that component.

Play Fullscreen Video

WinBridge.VideoPlayback.PlayVideoFullscreen(string videoUrl, bool controlsEnabled, bool tapSkipsVideo)

License

This repository is open-source and currently maintained by a small group of Microsoft developer evangelists. It should be noted that this plugin is provided as-is with no warranties given. Feel free to change code. It is released under the MS-LPL license. For details, please see the attached license.md (MS-LPL) or http://clrinterop.codeplex.com/license.