Can't find documentation on this. What is the proper use of SpriteShapeController.BakeMesh()? I have called it in my script but I cannot tell if it is doing anything.
First post on thread Sprite Shape 4.1.1 for Unity 2020.1 Looks like the official docs aren't up to date yet. I dunno why my formatting changed :/
I also noticed that BakeMesh() returns JobHandle, and if you don't write BakeMesh().Complete() then you can get a whole bunch of errors. But still I appear to be able to edit the spline.
Job system is pretty well documented. Might be able to piece it together. https://docs.unity3d.com/Manual/JobSystemSchedulingJobs.html
Please take a look at this Video on usage of Bake SpriteShape Geometry feature If you want to explicitly use SpriteShapeController.BakeMesh() for any custom purpose, you may also need to Complete the Job. var handle= SpriteShapeController.BakeMesh(); handle.Complete(); However, could you please let me know the use-case ?
@Venkify Thanks, it wasn't clear that the "Cache Geometry" button is baking the SpriteShape. I don't have any need to use BakeMesh() explicitly. I have levels with a somewhat complex SpriteShape (maybe somewhere between a few dozen and 100 vertices) where performance needs to be optimized for mobile. Before I was getting some fairly big spikes on Android from the renderer, but it seems fine now. Let me know if I'm going down the wrong path with this though.
I think I am also having this same problem. I even checked this website but I was not able to get the reply I wanted. Please were you able to resolve it?
Hey eddy. Doesn't look like that website would have solved your problem. But I think that the issue is solved by checking "Cached Geometry" on your SpriteShape from the inspector. Also, in a recent update they fixed an issue where SpriteShape required garbage collection on every frame. So make sure you are on the latest version of Unity, and you should be set.