Search Issue Tracker
By Design
Votes
0
Found in
2017.3.0f3
Issue ID
985754
Regression
No
"Does not contain a definition" error for texture.imageContentsHash when building
To reproduce:
1. Open attached Unity project "Unity201703BUG.zip"
2. Inspect "TestTexture" script in the Assets folder
3. Build and run the project
4. Inspect console
Result: "Type 'UnityEngine.Texture' does not contain a definition for 'imageContentsHash' and no extension method..." error, even though there was no compilation error and testing in play mode shows hash value of the texture correctly displayed in the console.
Note: "TestTexture" is not even used in the scene
Note: prior to 2017.3.0b4 the same error would not let you enter play mode, now it only affects build.
Reproduced on: 5.6.5f1, 2017.1.2p4, 2017.2.1p1, 2017.3.0p1, 2018.1.0b1
Comments (1)
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
- Test Runner’s vertical scrollbar overlaps with the up and down arrows and upper toolbar tabs when the window is minimized
- The Input Field view is not updated when deleting lines of text
- The scrollbar does not respect empty lines in the Input Field
- “Texture Atlas Viewer“ button text overlaps another button when the UI Toolkit Debugger is narrowed
- Thresholds are no longer automatically calculated after deleting Motion fields in Blendtrees
EddieOffermann
Apr 01, 2020 18:37
Issue was resolved and marked "By Design" but there should be additional explanation here:
Texture.imageContentsHash is only meant to work in the Editor because the "consumer" of that parameter is the Editor, not user code (at least not primarily). The documentation isn't very clear on this - it only mentions that it's Editor-only at the end of a paragraph in the middle of the documentation for the parameter. That should really be called out in the short description of the parameter that appears on any page for children of the Texture class.