Esempio n. 1
0
        private void OnPostprocessSprites(Texture2D texture, Sprite[] sprites)
        {
            TextureImporter         textureImporter         = assetImporter as TextureImporter;
            TextureImporterSettings textureImporterSettings = new TextureImporterSettings();

            textureImporter.ReadTextureSettings(textureImporterSettings);
            SpriteConfigData configData = SpriteConfigData.GetData(textureImporter.userData);

            if (textureImporterSettings.spriteMeshType != SpriteMeshType.Tight || !configData.overriden)
            {
                return;
            }

            MeshCreatorBase creator = MeshCreatorBase.GetInstnace(configData);

            foreach (var sprite in sprites)
            {
                creator.OverrideGeometry(sprite, configData);
            }
        }
        public void OverrideGeometry()
        {
            TextureInfo textureInfo = new TextureInfo(_mainImportData.sprite, _mainImportData.assetPath);

            _meshCreator.OverrideGeometry(_mainImportData.sprite, _mainImportData.dummySprite, textureInfo, _configData);
        }