Search Issue Tracker
By Design
Votes
0
Found in
2017.3.0a1
2018.2.16f1
2018.3.0a1
2019.1.0a1
2019.2.0a1
Issue ID
1101692
Regression
No
[IL2CPP] Plugin function returning incorrect unhdefined bool
Steps to reproduce:
1. Download the attached project and open "SampleScene" scene
2. Enter play mode
3. Notice that returned undefined bool is false
4. Build project with IL2CPP backend
5. Notice that returned undefined bool is true
Expected results: Player build with IL2CPP should return false bool
Actual results: Player build with IL2CPP returns true bool
Reproduced with: 2019.2.0a1, 2019.1.0a14, 2018.3.3f1, 2017.4.18f1
Tested on UWP and Standalone (Windows 10) platforms
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android]Resources fail to load when the AAB build contains a large Addressables Bundle
- Unity is loading internal version of SharpZipLib instead of local version
- The Context Menu items are ordered incorrectly
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
Resolution Note:
By default, p/invoke methods that return a C++ bool marshal that a four-byte value. In order to return it as a one-byte value, add the following attribute to the extern method in C#:
[return : MarshalAs(UnmanagedType.U1)]
This will cause IL2CPP to treat the return value as a C++ bool.