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

Scripting

-

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)

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.