Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

IL2CPP build fix - eliminating System.Reflection

A topic by Draque created 29 days ago Views: 55 Replies: 1
Viewing posts 1 to 2
(2 edits)

Just posting some code updates that I needed to make for my particular build. I use IL2CPP with basically all naming and hints stripped away, so reflection of this type can go haywire in compiled versions of my game. I'm linking to updated SuperTextMeshSubmesh.cs code that eliminates reflection. There is a gotcha that you probably already see here, though. If additional fields are added to Shadow or to Outline, this could cease to copy all relevant fields. Also, if the fields differed in prior versions of Unity, there would be problems there as well (for reference, I am building within Unity 2022.3.62f2). This still might be something worth including moving forward though, so I thought I would provide the update I made. I have not tested this in any other situations.

https://codepad.app/edit/xbe8uo63

NOTE: You'll have to select SuperTextMeshSubmesh.cs file, since CodePad is dumb and won't link it directly.

Developer

Sure this seems good, and might be okay to add... I don't think Shadow and Outline have changed since they were introduced so that might be okay. I'll give it a look later, I haven't really encountered compilation errors like that before. Either way, I just needed a solution to copy something exactly and chose the wrong one so I can switch that.


Also, SuperTextMeshSubmesh.cs is basically band-aid code for situations where you need to use UI text and it won't render a submesh, so just removing it from a  project is also an option too lol.