コガネブログ

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

【Unity】Embedded package [XXXX] was found in the directory [YYYY]. Please consider changing the directory name to match the package name.

概要

Embedded package [XXXX] was found in the directory [YYYY]. 
Please consider changing the directory name to match the package name.

Unity プロジェクトのバージョンを 2022.3 から 6000.0 にアップデートしたら
上記の警告が出力される現象に遭遇した。

パッケージのフォルダ名とパッケージ名が一致していないことが原因だった。

ChatGPT に依頼して上記の Python スクリプトを作成してもらった。

# まずはドライラン
python3 fix_embedded_packages.py --project 【Unity プロジェクトのパス】

# 実行(Unityは閉じておくのが安全)
python3 fix_embedded_packages.py --project 【Unity プロジェクトのパス】--apply

そして、上記のコマンドを実行すると
パッケージのフォルダ名とパッケージ名に一括でリネームしてくれる。