using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading; using UnityEngine; using UnityEditor; using Debug = UnityEngine.Debug; using Assets.Config; using Assets.Editor.BedTimeCreatorMenu; class ActorImportPostprocessor : AssetPostprocessor { private static GameConfigData _gameConfigData; static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { _gameConfigData = GameConfigDataManager.GetGameData(); // todo getting paths should be in a utility class //var actorsSrcPath = "Assets/ArtSrc/Actors"; var actorsSrcPath = "Assets/ArtExports/Actors"; foreach (string assetPath in importedAssets) { //todo a better test would be if the psd matches /actors/*/*.psd, but no psd deeper than that if (!assetPath.Contains("_SkeletonData") || !assetPath.Contains(actorsSrcPath)) { continue; } var newActor = new NewActorImporter(); newActor.AddNewActorPrefab(Path.GetDirectoryName(assetPath)); } } }