Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unity3d 如何从层次结构中的游戏对象而不是选择中构建资产绑定?_Unity3d_Assetbundle - Fatal编程技术网

Unity3d 如何从层次结构中的游戏对象而不是选择中构建资产绑定?

Unity3d 如何从层次结构中的游戏对象而不是选择中构建资产绑定?,unity3d,assetbundle,Unity3d,Assetbundle,我正在尝试自动从层次结构中手动选择游戏对象,然后用鼠标拖动到项目面板中,然后从菜单中选择“跟踪依赖项”,并将预置导出到.Unity3D文件中 我想通过代码来实现自动化 我认为这个过程就像。。。创建预置然后buildpipeline.BuildAssetBundle、、、但是buildpipeline.BuildAssetBundle中的前两个参数是问题,我无法使它们与游戏对象或预置匹配 第一个1以(对象)为主要资产,第二个以(对象[])为主要资产,它们引用内部资产文件。。。。。但我不能把它放在游

我正在尝试自动从层次结构中手动选择游戏对象,然后用鼠标拖动到项目面板中,然后从菜单中选择“跟踪依赖项”,并将预置导出到.Unity3D文件中

我想通过代码来实现自动化

我认为这个过程就像。。。创建预置然后buildpipeline.BuildAssetBundle、、、但是buildpipeline.BuildAssetBundle中的前两个参数是问题,我无法使它们与游戏对象或预置匹配 第一个1以(对象)为主要资产,第二个以(对象[])为主要资产,它们引用内部资产文件。。。。。但我不能把它放在游戏对象或预设上

    GameObject maw;
string paths="Assets";
public PrefabType dude;



void Start () {

    dude=PrefabUtility.CreatePrefab("Assets\temp",maw);

    // the problem is here the first 2 parameters ......    
    BuildPipeline.BuildAssetBundle((Object) dude, (Object[])dude, "Assets", 
    BuildAssetBundleOptions.CollectDependencies |               BuildAssetBundleOptions.CompleteAssets ,   BuildTarget.Android);



}