use crate::api::cache;
pub struct Screen;
impl Screen {
pub fn get_width() -> Result<i32, String> {
let class = cache::coremodule()
.class("UnityEngine.Screen")
.ok_or("Class 'UnityEngine.Screen' not found")?;
unsafe {
let method = class
.method("get_width")
.ok_or("Method 'get_width' not found")?;
method.call::<i32>(&[])
}
}
pub fn get_height() -> Result<i32, String> {
let class = cache::coremodule()
.class("UnityEngine.Screen")
.ok_or("Class 'UnityEngine.Screen' not found")?;
unsafe {
let method = class
.method("get_height")
.ok_or("Method 'get_height' not found")?;
method.call::<i32>(&[])
}
}
}