以下の内容はhttps://baba-s.hatenablog.com/entry/2021/07/29/090000より取得しました。


【Unity】FastEnum の ToName を使用する時にエラーが出る場合の対応方法

はじめに

using FastEnumUtility;
using UnityEngine;

public class Example : MonoBehaviour
{
    private void Awake()
    {
        Debug.Log( KeyCode.Z.ToName() );
    }
}

FastEnum の ToName を使用する時に

FileNotFoundException: Could not load file or assembly 
'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

上記のエラーが発生する場合は

NuGet Package Explorer を使用して

f:id:baba_s:20210716104504p:plain

「System.Runtime.CompilerServices.Unsafe」のパッケージのダウンロードと
エクスポートを行い、

f:id:baba_s:20210716104613p:plain

Unity で使用している API Compatibility Level と同じ
System.Runtime.CompilerServices.Unsafe.dll を

f:id:baba_s:20210716104740p:plain

Unity プロジェクトに追加します

これで FastEnum の ToName を使用する時にエラーが出なくなります




以上の内容はhttps://baba-s.hatenablog.com/entry/2021/07/29/090000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14