I got a 2d Texture and I want to change It’s color, I tried with “GUI.color = Color.black” “GUI.contentColor = Color.blue” but It didn’t change anything. How can I do this?
There’s the code I’m using:
public class PlayerGUI : MonoBehaviour {
[SerializeField]
Texture2D _crosshair;
void OnGUI()
{
float x = (Screen.width - _crosshair.width) / 2;
float y = (Screen.height - _crosshair.height) / 2;
GUI.DrawTexture(new Rect(x, y, _crosshair.width, _crosshair.height), _crosshair);
}
}