question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unity 2018.1.0b12: Can't create empty Texture (not allowed, needs to be subclass)

See original GitHub issue

This line causes projects to fail compilation:

https://github.com/thestonefox/VRTK/blob/e43089a4dbefba55af2716d22de31458e0b615ca/Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_MaterialColorSwapHighlighter.cs#L152

This can be fixed by replacing the line above with:

renderer.material.SetTexture("_MainTex", new Texture2D(0,0));

Cheers!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
thestonefoxcommented, Apr 8, 2018

Can confirm Texture2D.whiteTexture does not increase texture count whereas new Texture2D does.

Texture2D text = new Texture2D(0, 0); newtexture

vs

Texture2D text = Texture2D.whiteTexture; whitetexture

so whiteTexture is the solution imho

0reactions
kristianpdcommented, Apr 8, 2018

Cool, TIL. I’ll update the PR

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found