Closed johanhelsing closed 3 years ago
Note, I'm nowhere near making wasm actually work, but this is one of the first things I needed to fix.
The instant crate is also used by bevy for the same reasons (std instant panics on wasm)
Ok, it still panics later for on std::time::SystemTime::now()
so seems that will probably need replacing as well...
I think this should be all the time related fixes needed to work on wasm.
At least I have a fork of the bevy box_game that starts the app and loads the plugin without complaints if I comment out usages of UdpSocket API. Of course nothing happens since I still need to add an alternate transport method.
Calling std::time::Instant::now() causes a panic on wasm.
The instant crate tries to emulate std::time::Instant on wasm, and is a type alias to std::time::Instant otherwise.