Search Issue Tracker
Fixed in 2021.3.23f1, 2022.2.14f1, 2023.1.0b12, 2023.2.0a9
[IL2CPP] Using a Service Locator to retrieve a static list of classes doesn't work with IL2CPP in a built Player
Steps to reproduce:
1. Open the attached user's project "TapTapTap.zip"
2. Make sure to install this package https://github.com/Studious-Games/SingletonSystem
3. Build the "Scenes/MainGame.unityscene" Scene
4. Press the white dot to count the score
5. Observe the score not going up
6. Navigate to and open "Assets/Scripts/Spawner.cs", comment out 84'th line and uncomment the 81'st line
7. Repeat step 3
8. Observe that the score goes up
Expected results: "SingletonLocator.Get<ScoreManager>().DotsClicked++" works with IL2CPP scripting backend
Actual results: "SingletonLocator.Get<ScoreManager>().DotsClicked++" does not work with IL2CPP scripting backend
Reproducible on: 2020.3.41f1, 2021.3.13f1, 2022.1.22f1, 2022.2.0b13, 2023.1.0a18
-The difference is that "SingletonLocator.Get<ScoreManager>().DotsClicked++" is retrieved from a static list of classes, via a Service Locator, whereas "ScoreManager.Instance.DotsClicked++" is not.
-Issue reproduces only on IL2CPP with both Windows standalone and Android platforms
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- A vertical graphical artifact appears on Android Player when clearing Z & Stencil Buffer and running with OpenGLES3 Graphics API
- Player crashes when built with IL2CPP Scripting backend
- TextMeshPro package throws multiple Shader errors when importing TMP Essential Resources
- Package Manager search text field has no validation and leads to Editor freezes
- PlayerLoop.SetPlayerLoop() function is ignored when playing game in Player