Unity for Android is quite special. In unity for iOS packaging, the xcode project is directly handed over to developers. developers can
Add a new view, and then the developer packs and generates the IPA package and releases the program. While unity for Android package
Directly generating an APK package means that source code developers cannot see it, But unity does have some limitations.
You need to learn how to call Android Java code in unity. In this chapter, we aim to use the unity script to open the activity.
First, create a common android project. The directory structure is shown in.
Because the project needs to use the interface provided by unity, You need to introduce the interface classes. jar to the current project. Interface
The location of the package. Choose "Finder"> "application"> "Unity"> "Unity". Right-click the unity icon and choose "& ldquo;" to display the package content.
& Rdquo;-> contents-> playbackengines-> androidplayer-> bin-> classes. jar. After the interface package is introduced into the project, open
Write Java code.
Unitytestactivity. Java
Http://www.qdmm.com/BookReader/1163793,22685467.aspx
Http://www.qdmm.com/BookReader/1163793,22685479.aspx
Http://www.qdmm.com/BookReader/1163793,22699652.aspx
Http://www.qdmm.com/BookReader/1163793,22719361.aspx
Http://www.qdmm.com/BookReader/1163793,65455160.aspx
Http://www.qdmm.com/BookReader/1163793,65455311.aspx
Http://www.qdmm.com/BookReader/1163793,65455315.aspx
Http://www.qdmm.com/BookReader/1163793,65455341.aspx
Http://www.qdmm.com/BookReader/1163793,65455366.aspx
Http://www.qdmm.com/BookReader/1163793,65455374.aspx
Http://www.qdmm.com/BookReader/1163793,65455420.aspx
Http://www.qdmm.com/BookReader/1163793,65455438.aspx
Http://www.qdmm.com/BookReader/1163793,65455443.aspx
Http://www.qdmm.com/BookReader/1163793,65455459.aspx
Http://www.qdmm.com/BookReader/1163793,65455463.aspx
Http://www.qdmm.com/BookReader/1163793,65455464.aspx
Http://www.qdmm.com/BookReader/1163793,65455468.aspx
Http://www.qdmm.com/BookReader/1163793,65455471.aspx
Http://www.qdmm.com/BookReader/1163793,65455475.aspx
Http://www.qdmm.com/BookReader/1163793,65455483.aspx
Http://www.qdmm.com/BookReader/1163793,65455486.aspx
Http://www.qdmm.com/BookReader/1163793,65455491.aspx
Http://www.qdmm.com/BookReader/1163793,65455494.aspx
Http://www.qdmm.com/BookReader/1163793,65455498.aspx
Http://www.qdmm.com/BookReader/1163793,65455503.aspx
Package com. xys; import Android. content. Context; import Android. content. intent;
Import Android. OS. Bundle; import com. unity3d. Player. unityplayeractivity; Public
Class unitytestactivity extends unityplayeractivity {/** called when the activity is
First created. */context mcontext = NULL; @ override public void
Oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate );
?
Because the project needs to use the interface provided by unity, You need to introduce the interface classes. Jar