Exemple #1
0
        // draw GUI for material batcher
        void OnGUI()
        {
            currentAction = (Action)EditorGUILayout.EnumPopup("Action to perform: ", currentAction);

            profile = (NeoFurUtils.MaterialUtils.MaterialQuality)EditorGUILayout.EnumPopup("Type of Material:", profile);

            switch (currentAction)
            {
            case Action.BATCH:
                DoBatch(profile);
                break;

            case Action.DUPLICATE:
                NeoFurUtils.MaterialUtils.DuplicateMatsFromScene(profile);
                break;

            default:
                break;
            }

            if (GUILayout.Button("Cancel"))
            {
                Close();
                _window = null;
                return;
            }
        }
Exemple #2
0
        void DoBatch(NeoFurUtils.MaterialUtils.MaterialQuality profile)
        {
            EditorGUILayout.LabelField("Batch Text:");

            batchText = EditorGUILayout.TextField(batchText);

            if (GUILayout.Button("Create Batch"))
            {
                string[] names = batchText.Split(new char[] { ',', '\n' });

                for (int i = 0; i < names.Length; ++i)
                {
                    string name = names[i];

                    if (!string.IsNullOrEmpty(name))
                    {
                        NeoFurUtils.MaterialUtils.CreateMaterialAsset(NeoFurUtils.GetUniqueAssetPathNameInCurrentFolder(name), profile);
                    }
                }
            }
        }