Created
May 29, 2018 16:46
-
-
Save douglastaquary/854273f4ca64de812d99df9c4d64ca5f to your computer and use it in GitHub Desktop.
C# file - NativeBridge - BoomExample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class NativeBridge : MonoBehaviour { | |
[SerializeField] | |
private MeuComponente meucomponente; | |
#if UNITY_IOS && !UNITY_EDITOR | |
[DllImport("__Internal")] | |
private extern static void sendMessage(string boomText); | |
#else | |
private void sendMessage(string boomText) { | |
showMessage(boomText); | |
} | |
#endif | |
private void showMessage(string displayText) { | |
meuComponente.text = displayText; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment