/unity-aanp

Primary LanguageJavaApache License 2.0Apache-2.0

Unity auto Android native plugin

Generate C# wrapper classes for Android plugins, make it easy to use Android SDKs directly in Unity without extra coding.

Usage

java -jar unity-aanp-<version>.jar <inputJar> <outFile>

Features

  • JAR input
  • AAR input
  • Parse bytecode with javassist
  • Code generation with freemaker
  • Grammar translation
    • Static members
    • Instance members
    • Constructors
    • Enums
    • Interfaces
    • Static nested classes
    • Non-static nested classes
  • Type translation
    • Collection types
    • Known classes list
    • Types with extra conversion code required
    • Auto delegate generation
  • Option to support multi thread

Grammar Translation

Java C#
package namespace
class class
static inner class nested class
non-static inner class nested class with extra parent argument in constructor
field variable property
final field variable readonly property
field method field method

Examples

Example project: unity-aanp-test