sourceSets {
main {
//unity3D
jniLibs.srcDirs = [‘libs’, ‘libs-sdk’]
}
}
defaultConfig中添加
ndk {
abiFilters “armeabi-v7a”
}
在local.properties中配置ndk(替换你自己的ndk)
ndk.dir=…/Android/sdk/ndk/xxxx
Android架构中应当看到
创建UnityScene.java
package com.example.androidproject.unity;
import com.unity3d.player.UnityPlayer;
public class UnityScene {
public static UnityPlayer mUnityPlayer;
public UnityScene(){
}
}
创建一个空的Fragment,添加如下代码
private View playerView;
@Override
public View onCreateView(LayoutI