private void DisplayAddVariantsWindow(Shader shader, ShaderVariantCollection collection) { AddShaderVariantWindow.PopupData popupData = new AddShaderVariantWindow.PopupData(); popupData.shader = shader; popupData.collection = collection; string[] array; ShaderUtil.GetShaderVariantEntries(shader, collection, out popupData.types, out array); if (array.Length == 0) { EditorApplication.Beep(); } else { popupData.keywords = new string[array.Length][]; for (int i = 0; i < array.Length; i++) { popupData.keywords[i] = array[i].Split(new char[] { ' ' }); } AddShaderVariantWindow.ShowAddVariantWindow(popupData); GUIUtility.ExitGUI(); } }
// Show window to select shader variants void DisplayAddVariantsWindow(Shader shader, ShaderVariantCollection collection) { var data = new AddShaderVariantWindow.PopupData(); data.shader = shader; data.collection = collection; AddShaderVariantWindow.ShowAddVariantWindow(data); GUIUtility.ExitGUI(); }
private void DisplayAddVariantsWindow(Shader shader, ShaderVariantCollection collection) { AddShaderVariantWindow.PopupData data = new AddShaderVariantWindow.PopupData(); data.shader = shader; data.collection = collection; string[] keywords; ShaderUtil.GetShaderVariantEntries(shader, collection, out data.types, out keywords); if (keywords.Length == 0) { EditorApplication.Beep(); } else { data.keywords = new string[keywords.Length][]; for (int index = 0; index < keywords.Length; ++index) { data.keywords[index] = keywords[index].Split(' '); } AddShaderVariantWindow.ShowAddVariantWindow(data); GUIUtility.ExitGUI(); } }
// Show window to select shader variants void DisplayAddVariantsWindow(Shader shader, ShaderVariantCollection collection) { var data = new AddShaderVariantWindow.PopupData(); data.shader = shader; data.collection = collection; string[] keywordStrings; ShaderUtil.GetShaderVariantEntries(shader, collection, out data.types, out keywordStrings); if (keywordStrings.Length == 0) { // nothing available to add EditorApplication.Beep(); return; } data.keywords = new string[keywordStrings.Length][]; for (var i = 0; i < keywordStrings.Length; ++i) { data.keywords[i] = keywordStrings[i].Split(' '); } AddShaderVariantWindow.ShowAddVariantWindow(data); GUIUtility.ExitGUI(); }
private void DisplayAddVariantsWindow(Shader shader, ShaderVariantCollection collection) { string[] strArray; AddShaderVariantWindow.PopupData data = new AddShaderVariantWindow.PopupData { shader = shader, collection = collection }; ShaderUtil.GetShaderVariantEntries(shader, collection, out data.types, out strArray); if (strArray.Length == 0) { EditorApplication.Beep(); } else { data.keywords = new string[strArray.Length][]; for (int i = 0; i < strArray.Length; i++) { char[] separator = new char[] { ' ' }; data.keywords[i] = strArray[i].Split(separator); } AddShaderVariantWindow.ShowAddVariantWindow(data); GUIUtility.ExitGUI(); } }