Hi everyone, weird question: Has someone ever trie...
# multiplatform
s
Hi everyone, weird question: Has someone ever tried to integrate a Kmm Library in a Unity Project?
awkward monkey 2
d
Weirdest I've done was React Native, love to know if you can make Unity work haha
Maybe something here?
...or here?
s
Nice, thanks for your help @darkmoon_uk. I will look into the repos and try to get the gist what they are doing :D I had hopes that there is a more native approach since with Skie I can use kotlin in a more or less c-world, so I thought with this I could access the classes and functions of it directly in unity but let’s see what i can get out of your suggestions thanks a lot.
d
Unless I misunderstand what you're asking for, Unity Applications/Games are written in C#, so despite the name that's quite distinct from the C-world. It's another Virtual Machine ecosystem; Microsoft's CLR (Common Language Runtime).
It's quite uncommon to go through the looking glass on that one 😁 ...but you know, one should use the word 'impossible' very sparingly in this game. If you have enough of a reason to make it work I'm sure you'll find one.
Those projects clearly have, or did at one point. Probably borne of some enterprise software requirements, that's where C# and JVM seem most likely to collide, although in most cases you'd be happy to go-between via the Network layer.
Would Network do the trick for you or do you need tighter coupling and higher performance?
s
i at the moment managed to integrate a fat framework build from kmm to a xamarin project. All i needed was to create a apidefinitions file to get the functions and classes. So i thought this in someway could be done with unity too. 😄 oh darn i think i need to learn a bit more about unity first too it seems. thanks for the clarification.
d
Maybe I'm mistaken in guiding you towards JVM-CLR bridging, which is probably... complex. If it's just the ability to use Kotlin code with Unity, maybe use Kotlin/Native compiler and Unity-to-'native' abilities, which probably exist using the C ABI as more of a 'lingua franca'.
a
Someone was talking about integrating Kotlin with CIL yesterday in #compiler - it might be of interest? https://kotlinlang.slack.com/archives/C7L3JB43G/p1705248575870639