Version: 2022.1
Java and Kotlin source plug-ins
Create a Java or Kotlin source plug-in

Introducing Java and Kotlin source plug-ins

Unity supports Java and Kotlin code written in source files with .java and .kt extensions. To do this, Unity interprets each source file as an individual plug-in and compiles them when it builds the Player. This type of plug-in is useful if you need to write a small amount of code for a single project. If you plan to reuse the code in multiple projects or distribute it to other people, then an Android Library Projects or Android Archive plug-ins might be more appropriate.

其他资源

Java and Kotlin source plug-ins
Create a Java or Kotlin source plug-in