0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Unity6で画像をインポートするとSpriteImportModeがMultipleになる問題

Posted at

問題点

Unity 2022までは画像をUnityにインポートするとSpriteImportModeSingleだった。
しかし、Unity6からはデフォルトがMultipleになってしまう。
デフォルトをSigleに戻したい。

解決策

Editorフォルダを作って以下のファイルを配置すればSingleでインポートされます。

TextureAssetPostProcessor.cs
public class TextureAssetPostProcessor : AssetPostprocessor
{
    private void OnPreprocessTexture()
    {
        var textureImporter = assetImporter as TextureImporter;
        
        if (textureImporter is { importSettingsMissing: true })
        {
            if (textureImporter.spriteImportMode == SpriteImportMode.Multiple)
            {
                textureImporter.spriteImportMode = SpriteImportMode.Single;
            }
        }
    }
}

宣伝

役に立ったと思う方。良ければこちらのゲームで遊んでください。
(iOS/Android)
TownSoft

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?