Asset File Extension In UrlReference #1902
Bodyclock-Games
started this conversation in
Ideas
Replies: 1 comment
-
|
I don't think it makes sense to add the file extension. The raw asset could be any binary data (possibly in your custom format with no extension). For example you can add a suffix to your raw asset URl like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm loading a 16bit raw image as a RawAsset through the Content.OpenAsStream method. All works great. But I want to do some checks to make sure the asset is a raw file. One quick check is through the file extension. I tried the following code to get the extension:
RawAsset raw = Content.Load<RawAsset>(RawAssetUrl.Url); string ext = raw.MainSource.GetFileExtension(); Log.Error(ext); Content.Unload(raw);But I get the following error, which on reflection makes sense.
Stride.Core.Serialization.Contents.ContentManagerException: 'Unexpected exception while loading asset [Height Maps/Heights]. Reason: Content serializer for /Stride.Core.Assets.RawAsset could not be found.
I wondered if asset extension information could be added as a property to the UrlReference. It would be useful for a rudimentary check of the raw asset type.
Beta Was this translation helpful? Give feedback.
All reactions