美文网首页
unity创建资源及打包

unity创建资源及打包

作者: jojo911 | 来源:发表于2018-10-08 18:19 被阅读0次

    ```

    DynamicDependenciesHolder holder = ScriptableObject.CreateInstance<DynamicDependenciesHolder>();

            AssetDatabase.CreateAsset(holder,  "Assets/test.asset"); //这个是相对路径,Assets目录下的文件

            //AssetDatabase.CreateAsset(holder, Application.dataPath + "/test.asset"); 不能用绝对路径!!!

            AssetBundleBuild buildInfo = new AssetBundleBuild();

            buildInfo.assetBundleName = "bbb/test.x"; //这个是指在下面的test目录下的层级

            buildInfo.assetNames = new string[] { "Assets/test.asset" }; //这个是相对路径

            //test这个目录必须存在,否则返回ArgumentException: The output path "test/" doesn't exist

            BuildPipeline.BuildAssetBundles("test/", new AssetBundleBuild[] { buildInfo }, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows);

            EditorUtility.DisplayDialog("提示", Application.dataPath, "OK");

    ```

    相关文章

      网友评论

          本文标题:unity创建资源及打包

          本文链接:https://www.haomeiwen.com/subject/smbjaftx.html