Unity 判断是否选中了文件夹

UnityEditor下是否选中了文件夹

    [MenuItem("BuildAssets/选择文件夹")]
    public static void SelcetWaitBuildAB()
    {
        var Select = Selection.activeObject;

        var path = AssetDatabase.GetAssetPath(Select);

        if (!string.IsNullOrEmpty(path)&&!Path.HasExtension(path))
        {
            Debug.Log("选择到了文件夹");
        }
    }

你可能感兴趣的:(UnityEditor)