| Crates.io | cargo-udonsharp |
| lib.rs | cargo-udonsharp |
| version | 0.1.1 |
| created_at | 2025-11-06 21:35:38.10666+00 |
| updated_at | 2025-11-06 23:15:13.646458+00 |
| description | Cargo subcommand for UdonSharp compilation |
| homepage | https://github.com/LogicCuteGuy/WASMRS2USharp |
| repository | https://github.com/LogicCuteGuy/WASMRS2USharp |
| max_upload_size | |
| id | 1920741 |
| size | 79,425 |
A Rust-based framework that provides UdonSharp-like object-oriented programming patterns for VRChat world development. Write Rust code with UdonSharp semantics, then compile through WebAssembly to generate UdonSharp-compatible C# code.
# Install the framework
cargo install cargo-udonsharp
# Create a new UdonSharp project
cargo udonsharp new my-vrchat-world
# Build your project
cd my-vrchat-world
cargo udonsharp build
This framework creates a "Rust#" experience - Rust syntax with UdonSharp semantics:
Rust Code → WASM → Enhanced wasm2usharp → UdonSharp C# → VRChat
| Crate | Description |
|---|---|
udonsharp-core |
Core traits, types, and runtime helpers |
udonsharp-macros |
Procedural macros for UdonSharp attributes |
udonsharp-bindings |
Auto-generated API bindings (VRChat, Unity, C#) |
udonsharp-compiler |
Rust → WASM compilation pipeline |
udonsharp-cli |
Command-line interface and project management |
cargo-udonsharp |
Cargo subcommand integration |
udonsharp-build |
Build system and project templates |
wasm2usharp-enhanced |
Enhanced WASM → UdonSharp converter with OOP analysis |
udonsharp-performance |
Performance monitoring and optimization tools |
use udonsharp::prelude::*;
#[derive(UdonBehaviour)]
#[udon_sync_mode(Manual)]
pub struct WorldController {
#[udon_public]
pub world_name: String,
#[udon_sync]
pub player_count: i32,
initialized: bool,
}
impl UdonBehaviour for WorldController {
fn start(&mut self) {
self.initialized = true;
self.world_name = "My Rust World".to_string();
// Use VRChat APIs
let local_player = vrchat::Networking::local_player();
log::info!("World started by: {}", local_player.get_display_name());
}
fn on_player_joined(&mut self, player: VRCPlayerApi) {
self.player_count += 1;
// Use Unity APIs
let welcome_text = unity::GameObject::find("WelcomeText")
.unwrap()
.get_component::<unity::UI::Text>()
.unwrap();
welcome_text.set_text(&format!("Welcome {}! Players: {}",
player.get_display_name(),
self.player_count
));
}
}
wasm32-unknown-unknown targetThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.