unity Shader returns a NULL when using Shader.Find

2020-04-21 04:26发布

As stated here I am not the only one finding the following problem:

Shader.Find returns a Null.

In the link above they gave a solution by creating something(?) in the Resource Folder, but I am not sure I understand. First, is this necessary for all cases? (meaning Shader.Find does not work by itself?) Second, what should I add? An unlit shader?? a material? Very confused here

1条回答
对你真心纯属浪费
2楼-- · 2020-04-21 04:44

I could solve the problem finally by doing the following:

First, go to unity editor: Edit->Project Settings-> Graphics Then in the inspector where it says "Always Included Shaders" add "Unlit/Texture"

Then change my Shader.Find code to read Shader.Find("Unlit/Texture");

With this it does not return null anymore

查看更多
登录 后发表回答