This commit is contained in:
1 parent
09f707b139
commit
dc593978d8
4 files changed
+147
-45
No files matched your search
@@ -175,6 +175,10 @@ pub struct EditorAssetRef {
|
||||
/// UI label cached for inspectors. The asset registry/artifact remains authoritative.
|
||||
#[serde(default)]
|
||||
pub label: String,
|
||||
/// Optional loadable project path cached for runtime hydration when the
|
||||
/// referenced asset is not available through an imported artifact lookup.
|
||||
#[serde(default)]
|
||||
pub source_path: Option<String>,
|
||||
}
|
||||
|
||||
impl EditorAssetRef {
|
||||
@@ -187,9 +191,15 @@ impl EditorAssetRef {
|
||||
asset_id: asset_id.into(),
|
||||
sub_asset_id: sub_asset_id.into(),
|
||||
label: label.into(),
|
||||
source_path: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_source_path(mut self, source_path: impl Into<String>) -> Self {
|
||||
self.source_path = Some(source_path.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn is_resolved(&self) -> bool {
|
||||
!self.asset_id.trim().is_empty() && !self.sub_asset_id.trim().is_empty()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user