using XGame.Editor.Asset.Processor;
using UnityEditor;
using UnityEngine;

namespace #ProductName#.Editor.Imports
{
    public class XAssetPostprocessor : AssetPostprocessor
    {
        public static void OnPostprocessAllAssets(string[] importedAsset, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {

        }

        void OnPreprocessTexture()
        {
            var textureImporter = (TextureImporter)assetImporter;
            if (AssetsConfig.ImportHandle.TryApplyTextureImporter(assetPath, textureImporter))
            {
                return;
            }

        }

        void OnPostprocessTexture(Texture2D texture)
        {

        }

        void OnPreprocessModel()
        {
            var modelImporter = (ModelImporter)assetImporter;
            if (AssetsConfig.ImportHandle.TryApplyModelImporter(assetPath, modelImporter))
            {

            }
        }

        void OnPostprocessModel(GameObject model)
        {

        }
    }
}
