コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Unity 2020.3 から 2021.2 でテクスチャのインポート時間がどれだけ短縮されたか計測

はじめに

f:id:baba_s:20220105200028p:plain

100 個のテクスチャが格納されている Unity プロジェクトで

[MenuItem( "Tools/Reimport" )]
public static void Reimport()
{
    var sw = Stopwatch.StartNew();

    AssetDatabase.ImportAsset
    (
        "Assets/Textures",
        ImportAssetOptions.ForceUpdate | ImportAssetOptions.ImportRecursive
    );

    sw.Stop();
    UnityEngine.Debug.Log( sw.Elapsed.TotalSeconds );
}

テクスチャが格納されているフォルダを Reimport した時の処理時間を計測

計測結果

Unity のバージョン インポート時間
Unity 2020.3.13f1 71 秒
Unity 2021.2.7f1 43 秒