Add path function to ProcessContext (#12636)
# Objective - It can be useful to have access to the path of the current asset being processed, for example if you want to need a second file that is relative to the current file being processed. ## Solution - I added a `path()` function to the `ProcessContext`
This commit is contained in:
parent
ba0f033e8f
commit
fcf01a7925
@ -364,6 +364,12 @@ impl<'a> ProcessContext<'a> {
|
|||||||
Ok(loaded_asset)
|
Ok(loaded_asset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The path of the asset being processed.
|
||||||
|
#[inline]
|
||||||
|
pub fn path(&self) -> &AssetPath<'static> {
|
||||||
|
self.path
|
||||||
|
}
|
||||||
|
|
||||||
/// The source bytes of the asset being processed.
|
/// The source bytes of the asset being processed.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn asset_bytes(&self) -> &[u8] {
|
pub fn asset_bytes(&self) -> &[u8] {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user