SlideShare a Scribd company logo
1 of 10
Download to read offline
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>


More Related Content

What's hot

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.
 

What's hot (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
 

Viewers also liked

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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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...
 

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>