~starkingdoms/starkingdoms

ref: e796ffb2a4f90f597a0be294d3ba89d4c428d070 starkingdoms/crates/client/src/rendering/assets_native.rs -rw-r--r-- 299 bytes
e796ffb2 — ghostly_zsh assets no longer part of binary, now dynamically loaded 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use bevy_ecs::system::Resource;

#[derive(Resource)]
pub struct Assets {

}
impl Assets {
    pub fn new() -> Self {
        Assets {  }
    }
    pub fn get(&self, local_path: impl Into<String>) -> Option<Vec<u8>> {
        std::fs::read(format!("src/textures/{}", local_path.into())).ok()
    }
}