admin管理员组

文章数量:1122832

I am importing a Texture 2D component in my Player Controller script. I would like to know how I can change the value of the imported Texture 2D inside Player Controller.

Texture 2D component

Player Controller Script

I don't know if this is possible, didn't find it in the Unity documentation.

I am importing a Texture 2D component in my Player Controller script. I would like to know how I can change the value of the imported Texture 2D inside Player Controller.

Texture 2D component

Player Controller Script

I don't know if this is possible, didn't find it in the Unity documentation.

Share Improve this question asked yesterday Pedro ViegasPedro Viegas 1 New contributor Pedro Viegas is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 3
  • Import the texture twice, flip one -> exchange the texture ? – derHugo Commented yesterday
  • that's probably what I'll go for since I can't flip it at run time. thank you! – Pedro Viegas Commented yesterday
  • Depends a bit what exactly you are trying to achieve by that .. it basically inverts a normal map .. you could probably achieve the same by inverting the values pixel by pixel but then I'd rather have the double of memory usage and do it way faster ^^ – derHugo Commented yesterday
Add a comment  | 

1 Answer 1

Reset to default 0

This is not possible.

The Unity documentation for changing this value can be found at TextureImporter.flipGreenChannel, but TextureImporter is an editor class which can only be used in editor scripts, so you cannot change this value in runtime.

本文标签: