Exemplo n.º 1
0
        public static void ShowAddVariantWindow(AddShaderVariantWindow.PopupData data)
        {
            AddShaderVariantWindow window = EditorWindow.GetWindow <AddShaderVariantWindow>(true, "Add shader " + data.shader.name + " variants to collection");

            window.Initialize(data);
            window.m_Parent.window.m_DontSaveToLayout = true;
        }
Exemplo n.º 2
0
 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 Initialize(AddShaderVariantWindow.PopupData data)
 {
   this.m_Data = data;
   this.m_SelectedKeywords = new List<string>();
   this.m_AvailableKeywords = new List<string>();
   this.m_SelectedVariants = new List<int>();
   this.m_AvailableKeywords.Sort();
   this.m_FilteredVariants = new List<int>();
   this.ApplyKeywordFilter();
 }
Exemplo n.º 5
0
 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();
     }
 }
 public static void ShowAddVariantWindow(AddShaderVariantWindow.PopupData data)
 {
   AddShaderVariantWindow window = EditorWindow.GetWindow<AddShaderVariantWindow>(true, "Add shader " + data.shader.name + " variants to collection");
   window.Initialize(data);
   window.m_Parent.window.m_DontSaveToLayout = true;
 }