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

            importPanel             = new TextureImportPanel();
            importPanel.CurrentRule = orig;
            Undo.RecordObject(target, "assetruleundo");
        }
예제 #2
0
        private static void ExcuteTextureRule(UnityEditor.AssetImporter importer)
        {
            TextureAssetRule rule = FindRuleForAsset <TextureAssetRule>(importer.assetPath, "t:TextureAssetRule");

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

            EditorGUI.BeginChangeCheck();

            importPanel.OnRuleGUI(t);

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

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