+ 3
C#/Unity: Obsolete scripts
I have a warning after loading standard assets "supportsRenderTextures always returns true, no need to call it". Any thoughts how to fix it in code?
5 Respostas
+ 15
I know someone I can ask, but not til next week katerina. I do think sololearn should have Unity/Blender Q and A, thank you for the question
+ 11
Isn't it a warning only? (not an error) Does it stops running/compiling that code? I don't know why supportsRenderTextures always return true, but (as I can guess) you were told that you don't need to wrap your "enabled = false;" in "if", cause with !true it will never be executed. (Perhaps you can delete that part or (ex)change it to "enabled = true;" but I think variable "enabled" anyway defined somewhere else)
+ 1
You can check the value of supportsRenderTextures, and change its value into true.
I think this value is false or void.
0
Thanks guys! Unfortunately I can't find anything about my issue on Unity website. I'm totally newbie in coding so any help will be useful. I think I should add some details to my question.
I guess this part of the code causes the warning:
override protected void Start()
{
if (!SystemInfo.supportsRenderTextures)
{
enabled = false;
return;
}
base.Start();
}
How should I change it or can I simply delete this part of the code?
0
You're probably not struggling with this now, but if anyone out there is...
override protected void Start()
{
base.Start();
}
Because supportsRenderTextures always returns true.