Add material library and targeted surface drops

This commit is contained in:
Rbanh committed 2026-07-12 13:14:47 -04:00
1 parent 3931de1f0a
commit 02247f029a
24 files changed
+2794 -150

No files matched your search

+3 -4
View File
@@ -11,8 +11,7 @@ use bevy::prelude::*;
use crate::{
asset_server_path, authoring_component_active, brush_math::validate_brush,
AuthoringComponentStates, BrushDesc, BrushFaceDesc, ColliderDesc, InspectorOrder, LevelObject,
MaterialAsset, MaterialDesc, COMPONENT_BRUSH_DESC, COMPONENT_COLLIDER_DESC,
COMPONENT_MATERIAL_DESC,
MaterialDesc, COMPONENT_BRUSH_DESC, COMPONENT_COLLIDER_DESC, COMPONENT_MATERIAL_DESC,
};
use super::materials::material_from_desc;
@@ -214,8 +213,8 @@ fn brush_group_material(
texture_path: Option<&str>,
) -> StandardMaterial {
let mut material = material_path
.and_then(|path| MaterialAsset::load_from_path(path).ok())
.map(|asset| material_from_desc(asset_server, &asset.material))
.and_then(|path| crate::load_resolved_material_from_path(path).ok())
.map(|(desc, _)| material_from_desc(asset_server, &desc))
.or_else(|| parent_material.map(|material| material_from_desc(asset_server, material)))
.unwrap_or_else(default_brush_material);
if let Some(texture_path) = texture_path {