Skip to content

Instantly share code, notes, and snippets.

View brandenr's full-sized avatar

Branden Russell brandenr

  • Medici Ventures Inc
  • Salt Lake City, UT
View GitHub Profile
@brandenr
brandenr / gist:5118113
Last active March 10, 2020 18:57
iOS Unity Plugin
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()
@brandenr
brandenr / gist:5118128
Created March 8, 2013 17:20
Example Unity Script
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")]