Git Product home page Git Product logo

unitynativeplugin-template's Introduction

UnityNativePlugin-Template

THE GOAL

This project goal is to build a Unity native plugin to call simple c++ code,then it works on multiplatform.

c++ code is simple.

//NativePlugin.cpp
#include "NativePlugin.h"

NATIVE_API void jp_the6th_NativeSample_func1()
{
	return;
}

NATIVE_API int jp_the6th_NativeSample_func2(int i )
{
	return i;
}

Target Platform (trying now)

Platform Status
Unity Editor(Windows) ✅ Success
Windows Standalone ✅ Success
HoloLens 1(UWP/x86) ✅ Success
HoloLens 2(UWP/ARM64) Not yet
Android (ARM64) ✅ Success
Android (ARM) ✅ Success, but not tested
Android (x86) ✅ Success, but not tested
LuminOS(Magic Leap/ARM64) ✅ Success
Mac OS Not yet
iOS Not yet

System requirement

  • Windows 10
  • Unity 2019.1.0f1
  • Visual Studio 2017

How to use

A. Generate native plugins on Visual Studio 2017

  1. Open NativePlugin/NativePlugin.sln
  2. Toolbar -> Build -> Batch build ,then press [Build]
    • 7 of Dynamic libraries are generated to Unity project folder (UnitySample\Assets\Plugins).

B. Build Unity application each target platform.

  1. Open Unity project , /UnitySample , with Unity 2019.1.0f1.
  2. Setup Import plugin settings for each platform.
  3. Switch platform on build settings window.
  4. then,build and deploy it.

unitynativeplugin-template's People

Contributors

the6th avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.