-
Notifications
You must be signed in to change notification settings - Fork 857
[8.x.x Backport] Fixes for issue with Default shader and material not available when Models are imported at project startup. #515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,5 +53,31 @@ public static bool IsLWShader(Shader shader) | |
{ | ||
return s_ShaderPaths.Contains(shader.name); | ||
} | ||
|
||
#if UNITY_EDITOR | ||
static readonly string[] s_ShaderGUIDs = | ||
{ | ||
"933532a4fcc9baf4fa0491de14d08ed7", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks very manual and therefore brittle. Could we have symbolic constants or generate this automatically? |
||
"8d2bb70cbf9db8d4da26e15b26e74248", | ||
"650dd9526735d5b46b79224bc6e94025", | ||
"69c1f799e772cb6438f56c23efccb782", | ||
"b7839dad95683814aa64166edc107ae2", | ||
"8516d7a69675844a7a0b7095af7c46af", | ||
"0406db5a14f94604a8c57ccfbc9f3b46", | ||
"0ca6dca7396eb48e5849247ffd444914", | ||
}; | ||
|
||
internal static string GetShaderGUID(ShaderPathID id) | ||
{ | ||
int index = (int)id; | ||
if (index < 0 && index >= (int)ShaderPathID.Count) | ||
{ | ||
Debug.LogError("Trying to access universal shader path out of bounds"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should print params 'index' and 'count', so there's no need to debug to see what they were. |
||
return ""; | ||
} | ||
|
||
return s_ShaderGUIDs[index]; | ||
} | ||
#endif | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use Linq? How does that perform in practice?