Beispiel #1
0
    /// <summary>设置指定资源的Bundle名称</summary>
    /// <param name="arrAssets">指定文件路径(完整路径)</param>
    /// <param name="ContainDependences"></param>
    public static void SetTargetAssetBundleNames(UnityEngine.Object[] arrAssets, bool ContainDependences = true)
    {
        if (arrAssets == null || arrAssets.Length == 0)
        {
            return;
        }

        arrAssets.ActionAtItem <UnityEngine.Object>((UnityEngine.Object asset) =>
        {
            SetTargetFileBundleName(FileTool.AssetPathToFullPath(AssetDatabase.GetAssetPath(asset)), ContainDependences);
        });
    }
Beispiel #2
0
    /// <summary>设置指定文件的Bundle名称</summary>
    /// <param name="strRecsFullFilePath">指定文件路径(完整路径)</param>
    /// <param name="ContainDependences"></param>
    public static void SetTargetFilesBundleNames(string[] strRecsFullFilePath, bool ContainDependences = true)
    {
        if (strRecsFullFilePath == null || strRecsFullFilePath.Length == 0)
        {
            return;
        }

        strRecsFullFilePath.ActionAtItem <string>((string path) =>
        {
            SetTargetFileBundleName(path, ContainDependences);
        });
    }
    static void ShowSelction()
    {
        Object[] arr = Selection.objects;
        if (arr.isNull())
        {
            return;
        }

        arr.ActionAtItem <Object>((Object obj) =>
        {
            if (obj != null)
            {
                MyTool.LogOnlyAtEditor(obj.name + "   " + obj.GetType());
            }
        });
    }
    public static UnityEngine.Object[] GetSelectAssets()
    {
        UnityEngine.Object[] arr = Selection.GetFiltered(typeof(UnityEngine.Object), SelectionMode.DeepAssets);
        if (arr == null || arr.Length == 0)
        {
            return(null);
        }

        MyTool.LogOnlyAtEditor("选择了以下资源.......");
        arr.ActionAtItem <UnityEngine.Object>((UnityEngine.Object o) =>
        {
            if (null != o)
            {
                MyTool.LogOnlyAtEditor(AssetDatabase.GetAssetPath(o));
            }
        });

        return(arr);
    }