void OnEnable()
        {
            changed = false;
            orig    = (AudioAssetRule)target;

            importPanel             = new AudioImportPanel();
            importPanel.CurrentRule = orig;
            Undo.RecordObject(target, "assetruleundo");
        }
Ejemplo n.º 2
0
        private static void ExcuteAudioRule(UnityEditor.AssetImporter importer)
        {
            AudioAssetRule rule = FindRuleForAsset <AudioAssetRule>(importer.assetPath, "t:AudioAssetRule");

            if (rule == null)
            {
                Debug.Log("No audio rules found for asset");
            }
            else
            {
                rule.ApplySettings(importer);
            }
        }
        public override void OnInspectorGUI()
        {
            AudioAssetRule t = (AudioAssetRule)target;

            EditorGUI.BeginChangeCheck();

            importPanel.OnRuleGUI(t);

            if (EditorGUI.EndChangeCheck())
            {
                changed = true;
            }

            if (changed)
            {
                //                if (GUILayout.Button("Apply"))
                //                    importPanel.Apply(t);
                EditorUtility.SetDirty(t);
            }
        }