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 UnityEngine; | |
using System.Collections; | |
// We need this one for importing our IOS functions | |
using System.Runtime.InteropServices; | |
public class TestPlugin : MonoBehaviour | |
{ | |
// Use this #if so that if you run this code on a different platform, you won't get errors. | |
#if UNITY_IPHONE | |
[DllImport ("__Internal")] |
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
extern "C" | |
{ | |
int _pow2(int x) | |
{ | |
// Just a simple example of returning an int value | |
return x * x; | |
} | |
// Returns a char* (a string to Unity) | |
char* _helloWorldString() |