Unity 2018.1.0b12: Can't create empty Texture (not allowed, needs to be subclass)
See original GitHub issueThis line causes projects to fail compilation:
This can be fixed by replacing the line above with:
renderer.material.SetTexture("_MainTex", new Texture2D(0,0));
Cheers!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Unity 2018.1.0b12: Can't create empty Texture (not allowed ...
Unity 2018.1.0b12: Can't create empty Texture (not allowed, needs to be subclass) ... This can be fixed by replacing the line above with:...
Read more >Subclassing not possible
GUITexture does not inherits from MonoBehaviour , it inherits from Behaviour/Component and you can attach it to gameObject, That really strange ...
Read more >Control and Communication Systems for Automated ...
Driving simulators have been used in many applications, including traffic safety, ADAS implementation, driver distraction, human-machine-interaction, among ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm
Texture2D.whiteTexture
does not increase texture count whereasnew Texture2D
does.Texture2D text = new Texture2D(0, 0);
vs
Texture2D text = Texture2D.whiteTexture;
so
whiteTexture
is the solution imhoCool, TIL. I’ll update the PR