Unity Interact with android java
-
Unity导出AndroidStudio工程
-
在UnityPlayerActivity的onCreate时初始化Device (Device.onCreate(this);)
@Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); Device.onCreate(this); mUnityPlayer = new UnityPlayer(this); setContentView(mUnityPlayer); mUnityPlayer.requestFocus(); }
- Unity 2018.3
- AndroidStudio 3.2