Whinarn / UnityMeshSimplifier

Mesh simplification for Unity.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity 2021 Indexbuffer fix

Spongert opened this issue Β· comments

I wanted to try to make a commit and pull request, but don't think I can (don't use Github that much 😊)

Anyway, the conditionals need to have Unity 2021 included to make 32bit indices work, in that version. Otherwise, large meshes become a garbage. With it, it works perfect :-).

So in MeshUtils.cs:

#if UNITY_2018_2 || UNITY_2018_3 || UNITY_2018_4 || UNITY_2019 || UNITY_2020 || UNITY_2021
#define UNITY_8UV_SUPPORT
#endif

#if UNITY_2017_3 || UNITY_2017_4 || UNITY_2018 || UNITY_2019 || UNITY_2020 || UNITY_2021
#define UNITY_MESH_INDEXFORMAT_SUPPORT
#endif

Thanks @Spongert, I will deal with it.

You have to make a fork of the repository in order to make a pull request to here. Read this for more details in how to set this up properly.

I will probably reverse the if statements to avoid having to deal with this for every new major release of Unity.

Hi @Whinarn, I tried that but ran in some permission errors - but maybe I should experiment with forks using a private repository. Thanks for making the change already!

And I was going to suggest the same, to work the other way around (excluding 5.6 and earlier) but didn't want to sound too much of a critic, as UnityMeshSimplifier seems to work really well!

I just merged out my fix. So a new release should be ready any minute now.