{"id":13732432,"url":"https://github.com/keijiro/UnityRustPlugin","last_synced_at":"2025-05-08T06:32:21.079Z","repository":{"id":50308339,"uuid":"69736248","full_name":"keijiro/UnityRustPlugin","owner":"keijiro","description":"An example showing how to write a Unity native plugin in Rust","archived":false,"fork":false,"pushed_at":"2022-01-26T04:57:14.000Z","size":16168,"stargazers_count":138,"open_issues_count":0,"forks_count":15,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-04T02:11:08.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keijiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-01T11:59:10.000Z","updated_at":"2024-06-16T08:36:49.000Z","dependencies_parsed_at":"2022-09-05T16:40:52.702Z","dependency_job_id":null,"html_url":"https://github.com/keijiro/UnityRustPlugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keijiro%2FUnityRustPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keijiro%2FUnityRustPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keijiro%2FUnityRustPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keijiro%2FUnityRustPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keijiro","download_url":"https://codeload.github.com/keijiro/UnityRustPlugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224708291,"owners_count":17356509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T02:01:56.344Z","updated_at":"2024-11-14T23:32:27.074Z","avatar_url":"https://github.com/keijiro.png","language":"Shell","funding_links":[],"categories":["Shell","Game Development"],"sub_categories":["Unity Engine: Resources"],"readme":"UnityRustPlugin\n===============\n\n![Mandelbrot](http://66.media.tumblr.com/365885c6c0ef6c5a8fe2679969f2f46a/tumblr_oedb20nNKU1qio469o1_640.png)\n\nThis Unity sample project shows how to write a native plugin in the\n[Rust language].\n\nThe sample plugin constructs the Mandelbrot set in a big array (1024x1024x4\nbyte) shared from a C# script. Then the C# script converts it into a 2D texture\nto draw on the screen. See the [plugin code] and the [caller script] for\nfurther details.\n\nThis project was inspired by [Jim Flemming's article]. It's recommended to\ncheck the article if interested in the topic.\n\n[Rust language]: https://www.rust-lang.org\n[plugin code]: Plugin/src/lib.rs\n[caller script]: Assets/Test.cs\n[Jim Flemming's article]:\n  https://medium.com/jim-fleming/rust-lang-in-unity3d-eeaeb47f3a77\n\nHow to build the plugin\n-----------------------\n\nThe source code for the plugin is contained in the `Plugin` directory.\n\n### macOS/Linux\n\nYou can simply run `build.sh` to build the plugin.\n\n### Windows\n\nThere are some different approaches for Windows. I prefer using WSL2 and the\ncross-compilation target.\n\nFor cross-compilation from WSL2 to Windows, you have to install MinGW-w64 and\nthe `x86_64-pc-windows-gnu` target.\n\n```\nsudo apt install gcc-mingw-w64-x86-64\nrustup target add x86_64-pc-windows-gnu\n```\n\nNow you can run `build.sh`.\n\n### iOS\n\nInstall the `aarch64-apple-ios` target.\n\n```\nrustup target add aarch64-apple-ios\n```\n\nRun `build.sh` with passing `ios` to build the plugin.\n\n```\n./build.sh ios\n```\n\n### Android\n\nYou have to install NDK and set the `ANDROID_NDK` environment variable to\nspecify the installation directory.\n\nThen, install the `aarch64-linux-android` target.\n\n```\nrustup target add aarch64-linux-android\n```\n\nRun `build.sh` with passing `android` to build the plugin.\n\n```\n./build.sh android\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeijiro%2FUnityRustPlugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeijiro%2FUnityRustPlugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeijiro%2FUnityRustPlugin/lists"}