Description
When a particle effect uses a Texture2D in a non-local path that is also loaded in other contexts, the Texture2D name is not updated to the correct relative path or name as defined by the particle texture region.
For example, consider the case where the particle is at ./particles/particle.ember and has a relative path to the texture at ../maps/tiles.png. Since MGCB caches resources, if the game loads the texture2D in a different context, the name of the texture will not be relative to the particle as it should be for the particle to load it correctly.
In my case, this is fully solved by removing the non-null check that exists before assigning the name of the particle's texture.
Steps to Reproduce
- Create a particle effect that uses a texture that is not immediately local to the saved ember particle file
- Load the particle effect at runtime
- Load the same texture as a Texture2D from a different path in a different context. This will update the
name of the Texture2D.
- Load the particle effect a second time--the
name will not be updated due to the null check
Expected Behavior
The particle effect should load as expected by updating the texture.Name to be the same as the Texture2DRegion.Texture.Name from the particle effect.
Actual Behavior
Microsoft.Xna.Framework.Content.ContentLoadException: 'The content file was not found.'
Configuration
MGEX 6.0.1
Other Information
No response
Description
When a particle effect uses a Texture2D in a non-local path that is also loaded in other contexts, the Texture2D name is not updated to the correct relative path or name as defined by the particle texture region.
For example, consider the case where the particle is at
./particles/particle.emberand has a relative path to the texture at../maps/tiles.png. Since MGCB caches resources, if the game loads the texture2D in a different context, thenameof the texture will not be relative to the particle as it should be for the particle to load it correctly.In my case, this is fully solved by removing the non-null check that exists before assigning the name of the particle's texture.
Steps to Reproduce
nameof the Texture2D.namewill not be updated due to the null checkExpected Behavior
The particle effect should load as expected by updating the
texture.Nameto be the same as theTexture2DRegion.Texture.Namefrom the particle effect.Actual Behavior
Microsoft.Xna.Framework.Content.ContentLoadException: 'The content file was not found.'Configuration
MGEX 6.0.1
Other Information
No response