AndroidStudio embedded Unity

First, in the unity of the first to write your own function code

Here Insert Picture Description

Here Insert Picture Description

Second, unity and then export the project file android

Here Insert Picture Description

Here Insert Picture Description

Third, the new project androidstudio

Here Insert Picture Description

Here Insert Picture Description

Fourth, copy the jar package unity export libs folder to the next as project libs, then right-click to add to the database (Add As Library)

Here Insert Picture Description

Here Insert Picture Description

Fifth, copy the unity export project folder in the assets and jniLibs to as the src / main below, and copy UnityPlayerActivity to Java below

Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description

Sixth, in UnityPlayerActivity class to write a few words on the bottom, this is just an example, a project you can find a place to write their own

Here Insert Picture Description

Seven, in the xml configuration file into the Startup Items UnityPlayerActivity it's done

Here Insert Picture Description

Reference: https://www.jianshu.com/p/31b8877de531

Reference: https://blog.csdn.net/zouxin_88/article/details/79149384

Reference: https://blog.csdn.net/u010407393/article/details/79423769

Guess you like

Origin blog.csdn.net/qq_39353597/article/details/93010946