How to reproduce:
1. Open the attached “IN-140246” project
2. Select File → Build Profiles
3. In the Build Profiles window enable “Development Build”
4. Build and Run the project
5. Press key “D” on the keyboard
6. Observe the Player
Actual result: Prefabs on the left and right, instantiated by SimplePrefabSystem lose their material and disappear and ChangeMaterialColor script generates NullReferenceException when setting color of the shared material of Prefabs instantiated by SimplePrefabSystem
Expected result: Prefabs on the left and right, instantiated by SimplePrefabSystem remain as they are and ChangeMaterialColor script does not generate NullReferenceException
Reproducible with: 1.2.0 (6000.0.0b11), 1.4.6 (6000.3.15f1), 6000.4.6f1, 6000.5.0b7, 6000.6.0a4 (77e2e2eea1be)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- Only reproduces in the Player, does not reproduce in Editor
- Right instantiated GameObject corresponds to a Prefab referenced in a IComponentData struct using UnityObjectRef
- Left instantiated GameObject corresponds to a Prefab referenced in a IComponentData struct without using UnityObjectRef