Search Issue Tracker
Won't Fix
Votes
29
Found in
5.1.0b6
Issue ID
695955
Regression
No
Texture2D.alphaIsTransparency API is editor-only but lives in UnityEngine.dll
-e: Using Texture2D.alphaIsTransparency in a script causes the build to fail with the following error:
error CS1061: Type `UnityEngine.Texture2D' does not contain a definition for `alphaIsTransparency' and no extension method `alphaIsTransparency' of type `UnityEngine.Texture2D' could be found (are you missing a using directive or an assembly reference?)
-repro:
* Open attached example project.
* Go to File > Build Settings
* Select PC, Mac & Linux Standalone
* Select Target Platform "Windows x86"
* Press Build
* NOTICE the build fails.
Expected:
Using Texture2D.alphaIsTransparency should not break a build.
If this is intended to be an editor-only method, consider moving it in to UnityEditor.dll.
Update: This setting is available only in the Editor scripts. Note that changing this setting will have no effect; it must be enabled in TextureImporter instead.
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
- Crash on PrepareDrawShadowsCommandStep1 when entering the Play Mode in a specific project
- Physics Layer Collision Matrix's Layer names, checkboxes and hover highlights become misaligned when the Editor's UI Scaling gets changed
- Light/shadow information on an edge of a Terrain tile creates a seam with an adjacent Terrain tile when baking a LightMap
- "Missing types referenced from component UniversalRenderPipelineGlobalSettings on game object UniversalRenderPipelineGlobalSettings..." warning is thrown after switching the Platform to tvOS
- “Metal: Error creating pipeline state (Universal Render Pipeline/2D/Sprite-Lit-Default): Vertex attribute BLENDINDICES0(5) of type uint4 cannot be read using MTLAttributeFormatFloat2 (null)“ when setting GPU Skinning to GPU after opening the project
ArtyBrest
Jan 04, 2017 14:03
Reproduced in v5.5.0p3.
BMacZero
Nov 18, 2016 23:13
This flag needs to work at runtime to use dynamically-created textures as cursors, otherwise the cursors throw a "Invalid texture used for cursor" warning.
mineoc
Aug 30, 2016 07:04
This can also be reproduced on OSX 10.8 and Unity 5.4.0
chrismckenzie
Nov 07, 2015 02:18
To be clear, I would prefer to have this functionality available at run time outside of the editor. I cannot guarantee that loaded images will be preprocessed and the alphaIsTransparency apply works much faster than anything I can write in C#.
chrismckenzie
Nov 06, 2015 07:15
How else can someone apply alphaIsTransparency to a runtime loaded PNG?