Unity で「Faild to load window layout」が出てプロジェクトを開けない場合の対処方法

こんにちは。エクセルソフトの田淵です。

やっと Kudan AR のサンプルのアップデートをするために Unity を触り始めています。

Unity での Kudan AR のサンプルは GitHub にアップしてあります。

Kudan 社が作って公開していたサンプルをフォークしてメンテしているのですが、古いプロジェクトを Unity 2020 で開こうとしたら表題の「Faild to load window layout」のエラーが出て、プロジェクトが開なくなりました。

最悪なのは新規プロジェクトを開こうとしてもこのエラーが出て何もできないことです…笑 更に!Unity を再インストールしても直りませんでした…笑(弊社はリモートワーク中で、かつ私の自宅の回線が貧弱なので、アンインストール>ダウンロード>インストールにすごい時間がかかりました…w)

私は Mac で発生しましたが、Windows の Unity でも発生している方がいるようです。

現象と原因

(Unity)昔のプロジェクトを開いたら「Faild to load window layout」が出て詰んだときの対処 - Qiita の情報によると

なんとなくですが昔のプロジェクトのエディターのレイアウトデータ(2 by 3とかそういうやつを自分で大きさ変えたりしたのが保存されているはずなので)が読み込めなくなり、本来はデフォルトのレイアウトを読み込むところがなぜかデフォルトのレイアウトも読み込みすることができなくなっている状態だとみたいです

とのこと。確かに同じ現象でした。

解決方法

上記の Qiita の方も参照していますが、Unity Issue Tracker - "Failed to load window layout" error window is shown when trying to open projects and specific regional format is chosen の「KASD100SEP 17, 2020 13:01」の投稿の解決方法で解決できました。

When you get to the 3 options
1) Press [Load Default Layout]
(Unity copies the correct default layout to CurrentLayout-default.dwlt)

2a)Unity complains that it still cannot load the layout
2b) Press Load Default Layout. (this fixes the file)

3a) Copy the now correct CurrentLayout-default.dwlt somewhere (you can find the correct file, when you go to the folder you save your projects in, and enter the folder with the project name that you are trying to access, find “ CurrentLayout-default.dwlt” and copy it onto your computer somewhere.

4) Press Quit
(Unity corrupts the file during quitting)

5) Copy back the newly saved CurrentLayout-default.dwlt into the same place you got it from and delete the old corrupted one

6) Start Unity again

具体的には

  1. エラーのダイアログで「Load Default Layout」をクリックします。
  2. 正しいデフォルトレイアウトが Unity プロジェクト以下の Library/CurrentLayout-default.dwlt に作成されます。(多分 19KB くらい)
  3. 新しく作成された CurrentLayout-default.dwlt をデスクトップなどにコピーします。
  4. 「Quit」をクリックします。
  5. Unity が終了中にファイルを再度壊してしまいますw
  6. 終了後、デスクトップなどにコピーしておいた正しい CurrentLayout-default.dwltLibrary/CurrentLayout-default.dwlt に上書きします。
  7. Unity を起動します。

です。

これで、新規作成の時にも同じ問題に悩まされなくなりました。

Kudan AR SDK エントリー一覧

Kudan AR SDK チュートリアル記事まとめ | エクセルソフト ブログ

をご覧ください。Unity も少しずつ追加していきます。

参考サイト

以上です。

タイトルとURLをコピーしました