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


【Unity】Addressable Asset System でビルドできるファイルかどうかを確認する方法

概要

using UnityEditor;
using UnityEngine;

public static class Example
{
    [MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        var path          = AssetDatabase.GetAssetPath( Selection.activeObject );
        var mainAssetType = AssetDatabase.GetMainAssetTypeAtPath( path );
        var isFolder      = AssetDatabase.IsValidFolder( path );
        var isValid       = mainAssetType != typeof( DefaultAsset ) || isFolder;

        Debug.Log( isValid );
    }
}
  • MainAssetType が DefaultAsset ではない、もしくはフォルダであれば
    Addressable Asset System でビルドできる
  • 参考:GenerateLocationListsTask.cs の以下の処理
if (entry.MainAssetType == typeof(DefaultAsset) && !AssetDatabase.IsValidFolder(entry.AssetPath))
    throw new Exception($"Cannot recognize file type for entry located at '{entry.AssetPath}'. Asset import failed or using an unsupported file type.");



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

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