UnityEditor.SubstanceImporter.GetPrototypeNames C# (CSharp) Method

GetPrototypeNames() private method

private GetPrototypeNames ( ) : string[]
return string[]
        public extern string[] GetPrototypeNames();
        /// <summary>

Usage Example

示例#1
0
        private void MaterialManagement()
        {
            SubstanceImporter importer = this.GetImporter();

            if (this.m_PrototypeNames == null)
            {
                this.m_PrototypeNames = importer.GetPrototypeNames();
            }
            ProceduralMaterial selectedMaterial = this.GetSelectedMaterial();

            GUILayout.BeginHorizontal(this.m_SubstanceStyles.toolbar, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
            {
                if (this.m_PrototypeNames.Length > 1)
                {
                    Rect rect = GUILayoutUtility.GetRect(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarDropDown);
                    if (EditorGUI.DropdownButton(rect, this.m_SubstanceStyles.iconToolbarPlus, FocusType.Passive, this.m_SubstanceStyles.toolbarDropDown))
                    {
                        GenericMenu genericMenu = new GenericMenu();
                        for (int i = 0; i < this.m_PrototypeNames.Length; i++)
                        {
                            genericMenu.AddItem(new GUIContent(this.m_PrototypeNames[i]), false, new GenericMenu.MenuFunction2(this.InstanciatePrototype), this.m_PrototypeNames[i]);
                        }
                        genericMenu.DropDown(rect);
                    }
                }
                else if (this.m_PrototypeNames.Length == 1)
                {
                    if (GUILayout.Button(this.m_SubstanceStyles.iconToolbarPlus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        this.m_SelectedMaterialInstanceName = this.GetImporter().InstantiateMaterial(this.m_PrototypeNames[0]);
                        this.ApplyAndRefresh(true);
                    }
                }
                using (new EditorGUI.DisabledScope(selectedMaterial == null))
                {
                    if (GUILayout.Button(this.m_SubstanceStyles.iconToolbarMinus, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        if (this.GetSortedMaterials().Length > 1)
                        {
                            this.SelectNextMaterial();
                            importer.DestroyMaterial(selectedMaterial);
                            this.ApplyAndRefresh(true);
                        }
                    }
                    if (GUILayout.Button(this.m_SubstanceStyles.iconDuplicate, this.m_SubstanceStyles.toolbarButton, new GUILayoutOption[0]))
                    {
                        string text = importer.CloneMaterial(selectedMaterial);
                        if (text != "")
                        {
                            this.m_SelectedMaterialInstanceName = text;
                            this.ApplyAndRefresh(true);
                        }
                    }
                }
            }
            EditorGUILayout.EndHorizontal();
        }
All Usage Examples Of UnityEditor.SubstanceImporter::GetPrototypeNames