Auto 9 slice sprite generator on Unity.
- Package Manager
https://github.com/kyubuns/Auto9Slicer.git?path=Assets/Auto9Slicer
Create Auto9SliceTester. Assets > Create > Auto 9Slice > Tester
Click Run
to automatically slice the images in the same directory.
Add it to your EditorScript so that it will be executed at your desired timing.
var slicedTexture = Auto9Slicer.Slicer.Slice(texture, SliceOptions.Default);
textureImporter.spriteBorder = slicedTexture.Border.ToVector4();
File.WriteAllBytes(filePath, slicedTexture.Texture.EncodeToPNG());
- Requires Unity2019.4 or later
MIT License (see LICENSE)