Skip to content

A simple experimental setup to test the combination of Rust with Unity (iOS + Android)

Notifications You must be signed in to change notification settings

GlenDC/rust-and-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust and Unity

A repository containing experimental code to test the viability of developing a Rust library that can be used within a Unity (C#) Project. More specifically for games that would target iOS and Android.

Requirements

  • Rust;
  • Unity3D;
  • Multirust (a tool to switch between different rust environments for specific local folders):
    • this way you can download the nightlies for iOS/Android/OSX and use them for this repository;
    • You can find a nightly version with all the std libs @ Rust Downloads Archives;
    • I used the 2016/02/29 versions for my experiments and they work on all 3 platforms mentioned;
  • iOS Toolchain (Xcode + SDK);
  • Android ToolChain (SDK/NDK/Standalone Toolchain);
  • Maven (for building the java-jar-glue we'll need for Android Deployment);

Note About Rust Cross-Compilation

As long as you're developing within and OSX environment, it is pretty easy to deploy your code onto iOS and OSX. Pretty much the only requirements seem to be that you have the iOS SDK and have the std libs of your rust lib available in your Rust Environment. These can be build yourself if you like to wait for an hour, or you can simply download the from the archives as mentioned above.

For Android however you won't get away with simply downloading the SDK, NDK and setting up the Standalone toolchain. On top of that you also need to add 2 lines into your global $HOME/.cargo/config file:

[target.arm-linux-androideabi]
linker = "arm-linux-androideabi-gcc"

This basically defines that when passing the target to cargo build (as can be seen in the core/build.sh script of this repository) that it will use arm-linux-androideabi-gcc as the linker. As long as you've setup your Android Development Environment correctly, it should be as simple as that.

References

About

A simple experimental setup to test the combination of Rust with Unity (iOS + Android)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published