> module
std::stub::re::unity::time
Unity time control
use std::stub::re::unity::time; feature il2cpp-unity native only
std::stub::re::unity::time reads and writes Unity's Time.timeScale and reads Time.deltaTime and Time.frameCount. Useful for speed hacks and pause functionality.
> functions
> types
> examples
use std::stub::re::unity::time;
fn stub_main() -> Result<()> {
// Pause the game
time::set_scale(0.0)?;
// Double speed
time::set_scale(2.0)?;
// Restore normal speed
time::set_scale(1.0)?;
// Read frame timing
let dt = time::delta();
Ok(())
}