Unity를 안드로이드에서 사용 - Uaal 활용(1)

no노형우·2023년 8월 19일
0

안드로이드 기본 프로젝트에서 버튼을 생성하고 클릭시 유니티 앱이 실행되는 과정을 진행하고자 한다

출처 : https://learn-and-give.tistory.com/86

위 예제 프로젝트를 설치하고 다운 받는다

안드로이드 기본 프로젝트를 생성하고 유니티 앱을 실행하기 위한 버튼 생성

class MainActivity : ComponentActivity() {
    lateinit var unityIntent : Intent
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // 유니티 앱 인텐트 생성
        unityIntent = Intent(this, unityPlayerActivity::class.java)

        val button = findViewById<Button>(R.id.button_start)
        button.setOnClickListener {
            startActivity(unityIntent)
        }
    }
}

https://github.com/Unity-Technologies/uaal-ar-example

해당 사이트에서 유니티 프로젝트 파일을 설치

이제는 유니티 프로젝트 파일을 사용할거다

profile
노움의 기술블로그

0개의 댓글