No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SpriteShapeAssetPostProcessor.cs 867B

12345678910111213141516171819202122232425
  1. using UnityEngine;
  2. using UnityEngine.U2D;
  3. using UnityEditor;
  4. namespace UnityEditor.U2D
  5. {
  6. internal class SpriteShapeAssetPostProcessor : AssetPostprocessor
  7. {
  8. static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
  9. {
  10. if (importedAssets.Length > 0)
  11. {
  12. GameObject[] allGOs = UnityEngine.Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None);
  13. foreach (GameObject go in allGOs)
  14. {
  15. if (!go.activeInHierarchy)
  16. continue;
  17. SpriteShapeController sc = go.GetComponent<SpriteShapeController>();
  18. if (sc != null)
  19. sc.RefreshSpriteShape();
  20. }
  21. }
  22. }
  23. }
  24. }