private static void SearchShader(MenuCommand menuCommand) { NGShaderFinderWindow window = EditorWindow.GetWindow <NGShaderFinderWindow>(true, NGShaderFinderWindow.Title); window.targetShader = menuCommand.context as Shader; window.ClearResults(); }
private static void SearchShaderFromMaterial(MenuCommand menuCommand) { NGShaderFinderWindow window = EditorWindow.GetWindow <NGShaderFinderWindow>(true, NGShaderFinderWindow.Title); if ((menuCommand.context as Material) != null) { window.targetShader = (menuCommand.context as Material).shader; } window.ClearResults(); }
private static void SearchAsset(MenuCommand menuCommand) { NGShaderFinderWindow window = EditorWindow.GetWindow <NGShaderFinderWindow>(true, NGShaderFinderWindow.Title); window.targetShader = Selection.activeObject as Shader; if (window.targetShader == null) { window.targetShader = (Selection.activeObject as Material).shader; } window.ClearResults(); }