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?

More than 1 year has passed since last update.

Unityのパッケージインポートが終わらない

Last updated at Posted at 2023-09-25

2023/09/25 : 初稿
2023/11/08 : 追記
Unity : 2021.3.29f1

  • 2023/11/08追記分

原因判明。エディタ拡張で
.csや.shaderに対してAssetPostProcessorで
文字コードをUTF8に書き換えているのですが、
この処理がPackagesフォルダ以下のファイルにも行われていました。
パスが"Assets/"で始まるもののみに絞ることで発生しなくなりました。

  • 発生問題

プロジェクト開いたり、別のアプリに切り替えて戻ってきたりするたびにパッケージのreimportが走ってちっとも操作できない、みたいな症状に悩まされてます。

MacでもWindowsでも発生。マシンによって出ないこともあるようですが↓こんなwarningが出ます。

the package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
packages/com.unity.timeline/runtime/scripting/playabletrack.cs
...(以下たくさんファイルが列挙される)

まだ解決方法が見つかってないのですが、一番楽な回避策?を書いときます。

Unityで該当プロジェクトを開いたら、

Packages/manifest.json

をメモ帳なりCotEditorなりで開きます。で、適当にどこかにスペース文字でも書き込んで保存。書き込んだスペース削除してもっかい保存。

要はcygwinやterminalでtouchコマンド使えばいいのですが。とりあえずテキストエディタで開いて無理やり上書きする、ですw。っと、ファイルコピーして差し替える方が楽かもでした。バッチファイルとか作ればいいんだろうけど面倒臭い。

ともあれ、このあとUnityに戻すと、一回だけインポートが走るものの、上記のwarningが出ず、以降はインポート走らなくなります。謎。

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?