add trees
This commit is contained in:
+15
-1
@@ -30,6 +30,7 @@ const DIRT_WALL_PATH: &str = "dirt_wall.png";
|
||||
const ROCK_WALL_PATH: &str = "rock_wall.png";
|
||||
const BEDROCK_WALL_PATH: &str = "bedrock_wall.png";
|
||||
const LOG_PATH: &str = "log.png";
|
||||
const LEAVES_PATH: &str = "leaves.png";
|
||||
|
||||
pub fn initialize_textures(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
let mut textures: HashMap<String, Handle<Image>> = HashMap::new();
|
||||
@@ -76,6 +77,8 @@ pub fn initialize_textures(mut commands: Commands, asset_server: Res<AssetServer
|
||||
);
|
||||
texture_ids.insert(FIXTURE_ID_OFFSET + 4, LOG_PATH.to_string());
|
||||
textures.insert(LOG_PATH.to_string(), asset_server.load(LOG_PATH));
|
||||
texture_ids.insert(FIXTURE_ID_OFFSET + 5, LEAVES_PATH.to_string());
|
||||
textures.insert(LEAVES_PATH.to_string(), asset_server.load(LEAVES_PATH));
|
||||
|
||||
commands.insert_resource(Textures { handles: textures });
|
||||
commands.insert_resource(TextureIDs { refs: texture_ids });
|
||||
@@ -527,7 +530,18 @@ impl FixtureTilePrefab {
|
||||
FixtureTilePrefab {
|
||||
transform: Transform::from_translation(position),
|
||||
tile: FixtureTile {
|
||||
id: FIXTURE_ID_OFFSET + 3,
|
||||
id: FIXTURE_ID_OFFSET + 4,
|
||||
..Default::default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn leaves(position: Vec3) -> Self {
|
||||
FixtureTilePrefab {
|
||||
transform: Transform::from_translation(position),
|
||||
tile: FixtureTile {
|
||||
id: FIXTURE_ID_OFFSET + 5,
|
||||
..Default::default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
|
||||
Reference in New Issue
Block a user