背景
Unity 2020.x で作ったプロジェクトを互換性の問題から 2019.x で開く必要があった。
手順
① Unity Hubでプロジェクトのバージョンを切り替える

② 次に、エラーに対処する。最初に直面するのは 図2に示したUnity Collaborate 関連だ。

Library\PackageCache\com.unity.collab-proxy@1.7.1\Editor\Collaborate\UserInterface\Bootstrap.cs(23,20): error CS0117: 'Collab' does not contain a definition for 'ShowChangesWindow'
...
他にも15個くらいある。このエラーは Packages\manifest.json(図3, 4) を編集することで解決できる。


このファイルを開くと、”com.unity.collab-proxy”: “x.x.x” と書かれた行があるのでそれを削除(図5)

リロードすると、TMP関連のエラーが追加で出てくる(図6)。

Library\PackageCache\com.unity.textmeshpro@3.0.6\Scripts\Editor\TMP_PackageUtilities.cs(586,84): error CS0103: The name 'VersionControlSettings' does not exist in the current context
Library\PackageCache\com.unity.textmeshpro@3.0.6\Scripts\Editor\TMP_PackageUtilities.cs(1008,84): error CS0103: The name 'VersionControlSettings' does not exist in the current context
同様に manifest.json から “com.unity.textmeshpro”: “x.x.x” と書かれた部分を削除しても良いし、Window > Package Manager でアンインストールしても良い(図7)。

これで、一先ずパッケージまわりのエラーはすべて消える。

補遺
・UnityCollaborator
Unity Collaborator まわりの不具合はバージョンダウン時だけでなく、バージョンアップ時や何もしていなくても出る場合があるらしい。Window > Package Manager > Unity Collaborate > Update でも直るケースがあるとのこと。詳しくは “[Bug] Importing the project in Unity 2019.4 gives errors #591|GitHub” を参照。
これは本当に役に立ちました。この記事のおかげで、これらのエラーを引き起こしているのは Text Mesh Pro であることがわかりました。アンインストールして再インストールすることで、エラーが修正されました。