VirtualityForSafety / UnityWindowsTTS

Text-To-Speech for Unity + Windows
MIT License
5 stars 2 forks source link

Not compatible with IL2CPP #1

Open IvanMurzak opened 1 year ago

IvanMurzak commented 1 year ago
Building Library\Bee\artifacts\WinPlayerBuildProgram\3wbgm\rlow_cMethods23.obj failed with output:
GenericMethods23.cpp
F:\Projects\Unity\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\GenericMethods23.cpp(17994): error C2440: 'static_cast': cannot convert from 'PropertyType_t2B1DA41E5BA9A8802FAE896B1E2F98824B6DA8F8' to 'int32_t'
F:\Projects\Unity\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\GenericMethods23.cpp(17994): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
meredoth commented 1 year ago

I found two fixes that worked for me:

Encoding encoding 
=System.Text.Encoding.GetEncoding(System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ANSICodePage);
var data = encoding.GetBytes(msg);

lines.

comment out the addToSpeechQueue(data); add addToSpeechQueue(msg); and change the signature of the addToSpeechQueue(byte[] s) to addToSpeechQueue(string s); and then build