Search Issue Tracker




Found in


Issue ID




Building Player: HideFlags.HideAndDontSave not respected when ExecuteInEditMode is on.

Build Pipeline


Very serious issue affecting Unity 4.x and 4.1 (tested in RC3)
Incorrect dependencies in scene, not respecting HideFlags.HideAndDontSave when ExecuteInEditMode is on.

Repro steps.
1. Build and run the project
2. Open up the log and observe.
3. DumpAllTextures is called twice, once before and after the dynamically loaded texture is loaded in. Observe thta dk_i1 is loaded in BEFORE it is loaded and assigned (at runtime, its meant to only load dk_i2). After loading in, both i1 & i2 are loaded in, when only i2 is meant to be loaded in.

Expected behaviour: (and behaviour in 3.5)
- Before loading the texture in Awake, there should be no reference to dk_i1.

The code in Repro.cs should be self explanatory but some docs here.

1. In Awake, I create a material, hideflags.HideAndDontSave, load a texture using Resources.Load and assign it to the renderer. This material is destroyed in OnDestroy.

2. The script executes in edit mode, but is rigged to load a different texture dynamically in edit mode & play mode.

3. When building, it looks like Unity is saving a reference to the texture, but not the material.

It's a possible regression.

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.