Native Integration Module #3 of 6.

Slides:



Advertisements
Similar presentations
Cross Platform Mobile Development with.NET Greg Shackles Senior Software Engineer OLO Online Ordering
Advertisements

ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
.NET Core Libraries Common Language Runtime CodeGen Garbage Collector Security Model Exception Handling Loader & Binder Profiling & Debugging APIs Entity.
Win8 on Intel Programming Course Desktop : Sensors Cédric Andreolli Intel Software
B4 Application Environment Load Balancing Job and Queue Management Tim Smith CERN/IT.
PowerBuilder.NET Guided Tour. PowerBuilder A New PowerBuilder IDE for.NET Development.
ONLINE CONFERENCE DESIGN.BUILD.DELIVE R with WINDOWS PHONE THURSDAY 24 MARCH 2011.
Introduction CIS 136 Building Mobile Apps 1. What did we do Software review 2.
Alejandro Campos Magencio MS Technical Extreme Code Sharing with C# Y A XB.
Meet Adam Tuliper | Technical Evangelist, Microsoft –Focused on Gaming, Cloud, and Web Technologies –Emphasis on secure development practices.
Hot Tuna CROSS PLATFORM DEVELOPMENT WITH.NET, XAMARIN AND MVVMCROSS.
2 A First Look at Windows Presentation Foundation Everywhere ("WPF/E") Joe Stegman Lead Program Manager Microsoft Corporation.
Effective WinRT with C++ Tips and tricks for developing WinRT applications in C++
Bacon A Penetration and Auditing Framework Hernan Gips
Extend your app to multiple device families and use new capabilities by targeting the UWP.
Inventory:OCSNG + GLPI Monitoring: Zenoss 3
Developing Cross-Platform Applications with Visual Studio 2015
Windows 8 Hot or Not Piotr Włodek. Agenda MetroCharms Contracts WinRT App Execution Environment Motion Summary.
Scalable Game Development William Roberts Senior Game Engineer
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
Getting Started with Caliburn.Micro and Windows Phone 7 Gary Ewan Park Twitter: Blog:
The Windows Runtime (WinRT) is the shared runtime and API space used by store apps across the Windows platform (phone and client) 5 Common WinRT.
Plug-In Architecture Pattern. Problem The functionality of a system needs to be extended after the software is shipped The set of possible post-shipment.
Sponsors Gold Silver Bronze Custom REST services and jQuery AJAX Building your own custom REST services and consuming them with jQuery AJAX.
Windows Role-Based Access Control Longhorn Update
Windows 8 for Existing.NET Developers Tim Heuer Program Manager Windows Developer Experience Microsoft Corporation.
Building Windows Phone Applications with Silverlight Jaime Rodriguez
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
02 | Things to consider when porting Michael “Mickey” MacDonald | Indie game developer Bryan Griffiths | Software Engineer/Game Developer.
Exploring Networked Data and Data Stores Lesson 3.
NetBeans Rich Client Platform Simpletests NetBeans Rich Client Platform Simpletests Anton Epple Eppleton IT Consulting.
Migrating to ASP.NET Core Challenges & Opportunities
Porting your Unity Game to the Windows Store Jump Start
Windows Communication Foundation and Web Services
Mobile Device Development
12/29/2017 2:33 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Current Generation Hypervisor Type 1 Type 2.
Chapter 5- Assembling , Linking, and Executing Programs
Migrating 8.1 Apps to Windows 10
6/12/2018 3:52 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Cross Platform Development using Software Matrix
A whirlwind tour through the Microsoft DevOps landscape Jesse Houwing | xpirit.com/jesse Trainer, Coach, Tinkerer.
Delegates and Events 14: Delegates and Events
Ch 1. A Python Q&A Session Bernard Chen 2007.
Microsoft Build /13/2018 2:24 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Windows Communication Foundation and Web Services
Desktop App Converter (Project Centennial)
MonoGame and Windows 8.
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
HP C/C++ Remote developer plug-in for Eclipse
Myth Busting: Hosted Web Apps
William Roberts Ryan Hipple
and Executing Programs
Consuming Webservice in AX 2012
Phonegap Bridge Configuration file
Microsoft Build /30/2018 2:15 AM Migrating Silverlight Windows Phone apps to the Universal Windows Platform Ricardo Villalobos Principal SDE Manager.
Optimizations Module #4 of 6.
Build /2/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build /23/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Student: Popa Andrei-Sebastian
Microsoft Office 4/3/2019 Deep Dive into native Universal App development with the Office 365 APIs Speaker name Title Microsoft Corporation © 2012 Microsoft.
How to organize and document your classes
Microsoft Consumer Channels and Central Marketing Group
Running C# in the browser
Blazor A new framework for browser-based .NET apps Ryan Nowak
Plug-In Architecture Pattern
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

Native Integration Module #3 of 6

Windows integration

The communication chain XAML host (.exe) 1 Unity will listen to native events UnityPlayer provides callbacks and/or hooks You use Unity plugins to communicate to platform using WinRT APIs SwapChain for Unity Your Unity game (UnityPlayer.dll) 2 3 Platform services…

UnityApp (Phone) public static void BeginInvoke(Action action); Invokes a delegate on application thread, for calling script from UI thread public static void BeginInvoke(ActionWithArg action, object arg); Invokes a delegate on application thread, for calling script from UI thread public static bool BackButtonPressed(); Notifies Unity of BackButtonPress public static void Obscure(bool isLocked); Pauses Unity app thread public static void UnObscure(); public static void Quit(); Note: to call to XAML UI thread use Dispatcher.BeginInvoke ()

AppCallbacks (WinRT) void InvokeOnAppThread(AppCallbackItem item, bool waitUntilDone) Invokes a delegate on application thread, useful when you want to call your script function from UI thread. void InvokeOnUIThread(AppCallbackItem item, bool waitUntilDone) Invokes a delegate on UI thread, useful when you want to invoke something XAML specific API from your scripts. bool RunningOnAppThread() Returns true, if you're currently running in application thread. bool RunningOnUIThread() Returns true, if you're currently running in UI thread. bool UnityPause(int pause) Pauses Unity if you pass 1, unpauses if you pass 0, useful if you want to temporary freeze your game, for ex., when your game is snapped.

UnityEngine.WSA (Windows/Universal) Tile Toast Launcher LicenseInformation* * In UnityEngine.Windows namespace

Writing a plugin

Run-time reminder… Can’t inline platform code Mono compiler .NET for WP Plugins .NET compiler .NET for Win Store Can inline platform code Plugins

Writing a plugin

Writing a plugin One solution, 3 projects Same Assembly Name, Same namespaces Different preprocessor directives Make sure the directives are set at Configuration= All Configurations, Platform = All Platforms Shared codebases (via linked files) Different ‘target’ directories in Unity

Platform dependent compilation in Unity* Pre-processor define Description UNITY_EDITOR Define for calling Unity Editor scripts from your game code. UNITY_WP8 Platform define for Windows Phone 8. UNITY_METRO and UNITY_METRO_8_1 Platform define for Windows Store Apps (additionally NETFX_CORE is defined when compiling C# files against .NET Core). UNITY_WP_8_1 Platform define for Windows Phone 8.1, using Universal app model UNITY_WINRT Equivalent to UNITY_WP8 |UNITY_METRO *You must define the pre-processors manually in your plugins; these are auto-defined only in Unity

Unity Plugins folders Editor Assets\Plugins Windows Phone 8 Target platform Folder Editor Assets\Plugins Windows Phone 8 Assets\Plugins\WP8 Windows Phone 8.1 (Universal) Assets\Plugins\WindowsPhone8.1 Windows 8 Assets\Plugins\Metro or Assets\Plugins\Metro\Win80 Windows 8.1 Assets\Plugins\Metro or Assets\Plugins\Metro\Win81

The easy way: Free plugins from Store Essentials Ads Azure (Soon) Store Essentials Ads Azure $400+ plugins for free at http://prime31.com/plugins

Using 3rd party plugins

Bridges Expose interface Set Interface from native code Benefits: Avoid reference to .NET assembly types

Bridge

Consuming 3rd party plugins If you have plugins that are shipping as source code (such as NGUI), then the compiler will catch most issues for you. If you have plugins that ship as a binary that are not designed for Windows, you will likely get errors at run-time when you try to load them or use them. A good way to check if a plug-in is compatible with Windows Phone or Windows Store is to run it through the http://scan.xamarin.com

Porting run-times (Summary) Unity Editor Windows Phone (SL 8.0, SL 8.1) Windows Store 8.x & Phone 8.1 Compiles with Mono .NET Core At run-time Silverlight for Windows Phone .NET and WinRT Pre-processors UNITY_EDITOR UNITY_WP_8 UNITY_WP_8_1 UNITY_METRO Plugins directory \Plugins \Plugins\WP8 \Plugins\Metro Plugin strategy Binaries & Code Binaries