Created
February 14, 2014 15:28
-
-
Save KevinJones/9002973 to your computer and use it in GitHub Desktop.
This file contains 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
// a global function; no need to expose this in a header file | |
void internalDoSomething() | |
{ | |
// put your function here. | |
} | |
// note that if you were using C++ or Objective-C++ you'd need to put this in an extern closure, like so: | |
extern "C" | |
{ | |
void internalDoSomething() | |
{ | |
// ... | |
} | |
} |
This file contains 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
// In a Unity C# class: | |
public class MyCFunction { | |
public static void DoSoemthing() { | |
internalDoSomething(); | |
} | |
[DllImport ("__Internal")] | |
private static extern void internalDoSomething(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment