SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
Plugin
What is Plugin?
• Libraries of native code written in C, C++,
Objective-C,….etc
• Allow your game code to call functions from
these libraries
Why do you need to
develop a Plugin?
• Unity3D can’t Do That
• Reuse C/C++/Objective-C components
• Difficult customize in Unity3D Assets Store
• Cross-Device
• Cross-Platform
• Security Issues

Plugins for Different Device
• iOS
#if UNITY_IOS
#else

#endif
if (Application.platform == RuntimePlatform.IPhonePlayer)
• Android
#if UNITY_ANDROID
#else

#endif
if (Application.platform == RuntimePlatform.Android)
iOS Plugins
• C/C++ Native Functions in xxx.mm
extern “C”{
float ReturnFloat()
{ return 10.5; }
}
• C# Dll Import

using System.Runtime.InteropServices;
[DllImport("__Internal")]
public static extern float ReturnFloat();
iOS Plugins
• C/C++ Native Functions in xxx.h
void UnitySendMessage(const char* obj, const char* method, const
char* msg);
• C/C++ Native Functions in xxx.mm
extern “C”{
void UnityMessage(char* obj, char* function, char* message){
UnitySendMessage(obj, function, message);}
}
• C# Dll Import

using System.Runtime.InteropServices;
[DllImport("__Internal")]
public static extern float UnityMessage(string obj, string function, string
message);
Android Plugins
• C/C++ Native Functions in xxx.mm
extern “C”{
float ReturnFloat()
{ return 10.5; }
}
• C# Dll Import

using System.Runtime.InteropServices;
[DllImport("__Internal")]
public static extern float ReturnFloat();
Android Plugins
• Jave Class
public class PlugInBridge{
public static float ReturnFloat()
{ return 10.5f; }
}
• C#

AndroidJNI.AttachCurrentThread();
AndroidJavaClass androidClass = new AndroidJavaClass
("com.example.unityplugin.PlugInBridge");
Debug.Log(androidClass.CallStatic< float >(“ReturnFloat"));
Android Plugins
• Overwrite onActivityResult
public class FTUnityPlayerActivity extends UnityPlayerActivity
{
public void onActivityResult(int requestCode, int resultCode,
Intent data)
{
Log.d("FTUnityPlayerActivity", "onActivityResult:
requestCode: " + requestCode + ", resultCode:" + resultCode);
}
}
Android Plugins
• Modify your Manifest.xml Automatically
<activity
android:name="com.example.unityplugin.FTUnityPlayerActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>


Contenu connexe

Tendances

Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepChandramouli Biyyala
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)DroidConTLV
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Xavier Hallade
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with DartGDGKuwaitGoogleDevel
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDKBeMyApp
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 PlatformSebastian Mauer
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoTBartosz Kosarzycki
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentKarim Yaghmour
 
Alberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on AndroidAlberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on Androidgdg-ancona
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform ToolsOpersys inc.
 

Tendances (20)

Flutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by StepFlutter tutorial for Beginner Step by Step
Flutter tutorial for Beginner Step by Step
 
NDK Introduction
NDK IntroductionNDK Introduction
NDK Introduction
 
Android ndk
Android ndkAndroid ndk
Android ndk
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart#Code2Create:: Introduction to App Development in Flutter with Dart
#Code2Create:: Introduction to App Development in Flutter with Dart
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Introduction to the Android NDK
Introduction to the Android NDKIntroduction to the Android NDK
Introduction to the Android NDK
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
Android ndk: Entering the native world
Android ndk: Entering the native worldAndroid ndk: Entering the native world
Android ndk: Entering the native world
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android NDK and the x86 Platform
Android NDK and the x86 PlatformAndroid NDK and the x86 Platform
Android NDK and the x86 Platform
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android things introduction - Development for IoT
Android things introduction - Development for IoTAndroid things introduction - Development for IoT
Android things introduction - Development for IoT
 
Android NDK
Android NDKAndroid NDK
Android NDK
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Alberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on AndroidAlberto Mancini - A few benchmark on Android
Alberto Mancini - A few benchmark on Android
 
Developing Android Platform Tools
Developing Android Platform ToolsDeveloping Android Platform Tools
Developing Android Platform Tools
 

En vedette

Photon For Unity
Photon For Unity Photon For Unity
Photon For Unity Dat Pham
 
Unity5.3をさわってみた
Unity5.3をさわってみたUnity5.3をさわってみた
Unity5.3をさわってみたKeizo Nagamine
 
Unity In App Purchase (IAP)の使い方
Unity In App Purchase (IAP)の使い方Unity In App Purchase (IAP)の使い方
Unity In App Purchase (IAP)の使い方Makoto Ito
 
Unity5.3の機能まとめ
Unity5.3の機能まとめUnity5.3の機能まとめ
Unity5.3の機能まとめKeigo Ando
 
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...Jluis Dela Rosa
 
Roma solo fotos
Roma solo fotosRoma solo fotos
Roma solo fotoscarloslhoz
 
Semantický web a Drupal
Semantický web a Drupal Semantický web a Drupal
Semantický web a Drupal devmates
 
Chrome-eject がこの先生きのこるには
Chrome-eject がこの先生きのこるにはChrome-eject がこの先生きのこるには
Chrome-eject がこの先生きのこるにはYosuke HASEGAWA
 
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14Statistisk sentralbyrå
 
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...Lumea SEO PPC
 
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016DevOpsDays Tel Aviv
 
Madagascar analysis
Madagascar analysisMadagascar analysis
Madagascar analysiscroberts100
 
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014Eli Hurvitz
 
Tudatos márkaépítés
Tudatos márkaépítésTudatos márkaépítés
Tudatos márkaépítésGabor Papp
 

En vedette (20)

Photon For Unity
Photon For Unity Photon For Unity
Photon For Unity
 
Unity5.3をさわってみた
Unity5.3をさわってみたUnity5.3をさわってみた
Unity5.3をさわってみた
 
Unity In App Purchase (IAP)の使い方
Unity In App Purchase (IAP)の使い方Unity In App Purchase (IAP)の使い方
Unity In App Purchase (IAP)の使い方
 
Unity5.3の機能まとめ
Unity5.3の機能まとめUnity5.3の機能まとめ
Unity5.3の機能まとめ
 
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...
C mo-ganarse-la-vida-escribiendo-orientaciones-para-desarrollar-la-escritura-...
 
Roma solo fotos
Roma solo fotosRoma solo fotos
Roma solo fotos
 
Boletín IV enero 2016
Boletín IV enero 2016Boletín IV enero 2016
Boletín IV enero 2016
 
Semantický web a Drupal
Semantický web a Drupal Semantický web a Drupal
Semantický web a Drupal
 
Chrome-eject がこの先生きのこるには
Chrome-eject がこの先生きのこるにはChrome-eject がこの先生きのこるには
Chrome-eject がこの先生きのこるには
 
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14
SSBs Erling Holmøy_Norge eldes: Langsiktig økonomisk bærekraft 28.01.14
 
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...
Roxana Ivan - Buget mic pentru evenimente mari (Impact Hub Bucharest, 2014.02...
 
Tesla Croatia
Tesla CroatiaTesla Croatia
Tesla Croatia
 
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016
Doing Terrifying Things - Nati Cohen, Similarweb - DevOpsDays Tel Aviv 2016
 
Shepherd Elementary School Community Meeting Flyer
Shepherd Elementary School Community Meeting FlyerShepherd Elementary School Community Meeting Flyer
Shepherd Elementary School Community Meeting Flyer
 
Madagascar analysis
Madagascar analysisMadagascar analysis
Madagascar analysis
 
Philomena Detailed CV
Philomena Detailed CVPhilomena Detailed CV
Philomena Detailed CV
 
Marcelo acosta ac
Marcelo acosta acMarcelo acosta ac
Marcelo acosta ac
 
Hopes, plans and pleasures of children
Hopes, plans and pleasures of childrenHopes, plans and pleasures of children
Hopes, plans and pleasures of children
 
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014
חשבון נפש: מצב לימודי המתמטיקה בישראל - 2014
 
Tudatos márkaépítés
Tudatos márkaépítésTudatos márkaépítés
Tudatos márkaépítés
 

Similaire à Plugin For Unity

SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...BIWUG
 
Developing On the IntelliJ Platform
Developing On the IntelliJ PlatformDeveloping On the IntelliJ Platform
Developing On the IntelliJ PlatformYann Cébron
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitDimitry Snezhkov
 
Adding Love to an API (or How to Expose C++ in Unity)
Adding Love to an API (or How to Expose C++ in Unity)Adding Love to an API (or How to Expose C++ in Unity)
Adding Love to an API (or How to Expose C++ in Unity)Unity Technologies
 
Program Verification / Automated Theorem Proving
Program Verification / Automated Theorem ProvingProgram Verification / Automated Theorem Proving
Program Verification / Automated Theorem Provinglokeshwer2
 
MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363mokacao
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in Androidrahulverma1080
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchJonas Follesø
 
Debot android debugging library
Debot android debugging libraryDebot android debugging library
Debot android debugging libraryTomoaki Imai
 
iOS and Android Development with Unity3D
iOS and Android Development with Unity3DiOS and Android Development with Unity3D
iOS and Android Development with Unity3DRalph Barbagallo
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...Radu Vunvulea
 
C++ in windows phone apps
C++ in windows phone appsC++ in windows phone apps
C++ in windows phone appsMirco Vanini
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to DistributionTunvir Rahman Tusher
 

Similaire à Plugin For Unity (20)

SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
Developing On the IntelliJ Platform
Developing On the IntelliJ PlatformDeveloping On the IntelliJ Platform
Developing On the IntelliJ Platform
 
Typhoon Managed Execution Toolkit
Typhoon Managed Execution ToolkitTyphoon Managed Execution Toolkit
Typhoon Managed Execution Toolkit
 
CFInterop
CFInteropCFInterop
CFInterop
 
Adding Love to an API (or How to Expose C++ in Unity)
Adding Love to an API (or How to Expose C++ in Unity)Adding Love to an API (or How to Expose C++ in Unity)
Adding Love to an API (or How to Expose C++ in Unity)
 
Xamarin - Beyond the Basics
Xamarin - Beyond the BasicsXamarin - Beyond the Basics
Xamarin - Beyond the Basics
 
Program Verification / Automated Theorem Proving
Program Verification / Automated Theorem ProvingProgram Verification / Automated Theorem Proving
Program Verification / Automated Theorem Proving
 
MSMDC_CLI363
MSMDC_CLI363MSMDC_CLI363
MSMDC_CLI363
 
Compilation Of C/C++ program in Android
Compilation Of C/C++ program in AndroidCompilation Of C/C++ program in Android
Compilation Of C/C++ program in Android
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
Debot android debugging library
Debot android debugging libraryDebot android debugging library
Debot android debugging library
 
iOS and Android Development with Unity3D
iOS and Android Development with Unity3DiOS and Android Development with Unity3D
iOS and Android Development with Unity3D
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu vunvulea  building and testing windows 8 metro style applications using ...Radu vunvulea  building and testing windows 8 metro style applications using ...
Radu vunvulea building and testing windows 8 metro style applications using ...
 
C# Application lifecycle
C# Application lifecycleC# Application lifecycle
C# Application lifecycle
 
Android class provider in mumbai
Android class provider in mumbaiAndroid class provider in mumbai
Android class provider in mumbai
 
C++ in windows phone apps
C++ in windows phone appsC++ in windows phone apps
C++ in windows phone apps
 
iOS,From Development to Distribution
iOS,From Development to DistributioniOS,From Development to Distribution
iOS,From Development to Distribution
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
 
C# everywhere
C# everywhereC# everywhere
C# everywhere
 

Dernier

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Plugin For Unity

  • 2. What is Plugin? • Libraries of native code written in C, C++, Objective-C,….etc • Allow your game code to call functions from these libraries
  • 3. Why do you need to develop a Plugin? • Unity3D can’t Do That • Reuse C/C++/Objective-C components • Difficult customize in Unity3D Assets Store • Cross-Device • Cross-Platform • Security Issues

  • 4. Plugins for Different Device • iOS #if UNITY_IOS #else
 #endif if (Application.platform == RuntimePlatform.IPhonePlayer) • Android #if UNITY_ANDROID #else
 #endif if (Application.platform == RuntimePlatform.Android)
  • 5. iOS Plugins • C/C++ Native Functions in xxx.mm extern “C”{ float ReturnFloat() { return 10.5; } } • C# Dll Import
 using System.Runtime.InteropServices; [DllImport("__Internal")] public static extern float ReturnFloat();
  • 6. iOS Plugins • C/C++ Native Functions in xxx.h void UnitySendMessage(const char* obj, const char* method, const char* msg); • C/C++ Native Functions in xxx.mm extern “C”{ void UnityMessage(char* obj, char* function, char* message){ UnitySendMessage(obj, function, message);} } • C# Dll Import
 using System.Runtime.InteropServices; [DllImport("__Internal")] public static extern float UnityMessage(string obj, string function, string message);
  • 7. Android Plugins • C/C++ Native Functions in xxx.mm extern “C”{ float ReturnFloat() { return 10.5; } } • C# Dll Import
 using System.Runtime.InteropServices; [DllImport("__Internal")] public static extern float ReturnFloat();
  • 8. Android Plugins • Jave Class public class PlugInBridge{ public static float ReturnFloat() { return 10.5f; } } • C#
 AndroidJNI.AttachCurrentThread(); AndroidJavaClass androidClass = new AndroidJavaClass ("com.example.unityplugin.PlugInBridge"); Debug.Log(androidClass.CallStatic< float >(“ReturnFloat"));
  • 9. Android Plugins • Overwrite onActivityResult public class FTUnityPlayerActivity extends UnityPlayerActivity { public void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d("FTUnityPlayerActivity", "onActivityResult: requestCode: " + requestCode + ", resultCode:" + resultCode); } }
  • 10. Android Plugins • Modify your Manifest.xml Automatically <activity android:name="com.example.unityplugin.FTUnityPlayerActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>