问题标签 [assetbundle]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
845 浏览

yii2 - How to add assetbundle js/css add only in one page in yii2?

I have added fullcalendar js/css in vendor/bower folder. I want to add this into just one page.

I read abt AssestBundle on this link - http://www.yiiframework.com/doc-2.0/guide-structure-assets.html

But this add in all the pages.

0 投票
1 回答
1649 浏览

c# - LoadFromCacheOrDownload 如果文件存在,如何从缓存中加载

我正在使用下面的代码,如果捆绑包仅是第一次安装它就可以工作,否则我会收到捆绑包已经存在的错误。所以我的问题是如何检查捆绑包是否存在,如果存在,从缓存文件中读取它

谢谢

0 投票
1 回答
405 浏览

php - Yii2:registerJs() 隐式包含JqueryAsset,如何避免

在 Yii2$this->registerJs()中,视图中有一个注册内联 JS 的方法。我按照文档中的描述使用它:

问题是 with View::POS_READY(这是第二个参数的默认值)registerJs()隐式需要yii\web\JqueryAssetsource code)。

但是我已经将 Jquery 包含在我自己的资产包中 - 它是all-min.js,有 Jquery + 插件在单个文件中被缩小和连接。Yii2 包含JqueryAsset,因此在结果页面上复制 Jquery。

我如何告诉 Yii2 Jquery 已经包含在内或以其他方式避免这种重复?

0 投票
2 回答
2008 浏览

unity3d - 资产包未加载?

您好,我正在为学校项目制作游戏,但遇到了这个错误。在此处输入图像描述

如您在此处看到的,代码加载了我已将其添加到构建设置中的场景。 在此处输入图像描述

请帮忙!

0 投票
0 回答
1315 浏览

unity3d - 在运行时创建 Unity 资源包

我有一个 Windows 应用程序,用户可以将 fbx 模型导入其中。我想要做的是能够从这些导入的 fbx 模型创建资产包,然后将包文件保存到服务器。我想问如果团结起来,这样的事情是否可能。我已经搜索了答案,但找不到任何答案,有一些类似的线程,但没有一个能完全解决这个问题。如果有人可以帮助我,我将不胜感激。谢谢

0 投票
2 回答
1699 浏览

yii2 - 如何将整个目录添加到资产包 yii2 中的 js 部分

如何将整个目录添加到资产包 yii2 中的 js 部分

我认为这将是这样的

我想要这个,因为我不希望每次(当我缩小我的 css 或缩小我的 js 时)在资产包中写这样的东西

而不是写'module.min.js', 'module2.min.js'我想写一些像正则表达式(添加整个目录)的东西,它将从目录中收集所有文件并将它们添加到我的资产包中,我的$js数组将如下所示

那么如何实现呢?是否有“开箱即用”的解决方案?请帮忙。我问这个是因为'我(我使用 gulp 和不同的缩小器等)在资产包中写入是否正常module.min.cssmodule.min.js'

0 投票
3 回答
1387 浏览

yii2 - 无法使用 assets/registerCss 函数注册 css/js

我创建了一个 testasset.php 如下:

在控制器中,我只是渲染在资产上方注册的视图文件。

看法 :

但是我的 test.css 文件没有被注册。我也尝试过使用 basepath 和 baseurl 以及 registerCss Yii2 函数,但没有成功。

任何人请提出我的代码中缺少的地方。

0 投票
0 回答
767 浏览

c# - 从 Unity 中的 AssetBundle 中排除 C# 脚本

我目前正在使用 Unity3D 为 WinRT 平台构建应用程序。我有2个项目:

  1. 可以下载/加载 AssetBundle 并从中打开场景的主项目。
  2. 具有多个场景的项目,可生成可由项目 1 加载的 AssetBundle。

每当我构建应用程序时,都会编译所有脚本,并最终从 AssetBundle 中排除。这正是我想要的,因为这样我可以强制项目 2 可以使用项目 1 定义的共享脚本,但不能创建自定义脚本。(只需给它们相同的名称,当您在项目 1 中加载 AssetBundle 时,Unity 会自动加载正确的脚本)。

但是,当我在 Project2 中使用 async/await 代码或使用其他一些 WinRT 函数时,我在编译 AssetBundles 时遇到了编译错误。我真的不明白为什么,因为最终脚本无论如何都不会被包含在内。(如果我加载在 Project2 中定义但不在 Project1 中定义的脚本,我会看到“缺少脚本”错误,这是我所期望的)。

所以基本上,我想要的是能够创建一个 AssetBundle,带有指向脚本的链接,但不编译脚本(因为编译的脚本将存在于 Project1 中)。

我还尝试定义“UNITY_EDITOR”属性(在编辑>项目设置>播放器下)(因为我的异步/等待代码在编译期间使用它来省略部分代码),但这会导致更多错误不再查找某些命名空间,例如: using UnityEngine.VR.WSA.Sharing;显示错误:error CS0234: The type or namespace name 'Sharing' does not exist in the namespace 'UnityEngine.VR.WSA'.

有没有人知道如何解决/解决这个问题?

0 投票
1 回答
1005 浏览

unity3d - 增强现实:动态模型加载

我对增强现实和 Unity 3D 完全陌生。我正在处理的项目要求我仅在从列表中选择 3D 对象后将其加载到相机上。

例如,首页会给你一个列表,上面写着 Apple、Orange、Mango,当我点击 Apple 时,3D 苹果模型应该出现在相机上。

你们中的任何人都可以告诉我如何在运行时将 3D 模型从资产包加载到目标上吗?

0 投票
0 回答
934 浏览

ios - Unity3D Asset Bundle Animator Dependencies

Problem:

While packing an Animation Controller I am getting a ton of unwanted dependencies.

Description:

So I have a animation controller loaded up with animations and parameters. These animations are all separated into their own FBX's and make use of Unity's Humanoid Animation type, taking their avatar off of the base character rig. As expected, but not desired ( the base rig fbx is added and it's shaders etc ) despite the fact that they are going to be packed in the actual application. This is not my biggest issue.

My biggest issue is that every single texture used on all of my various characters that make use of these humanoid animations are being packed into my asset bundle.

Things I have tried:

-Looking through all the animations to see if they manipulate textures

-Checking to make sure all the textures have no 'Asset labels' that designate their packing.

-Selected the dependencies of the Animation controller. Which resulted in the base rigs materials / textures as well as the humanoid animations added (shown as game objects). This is everything I expect to be in the asset bundle, but it packs all textures / materials in my project instead.

enter image description here

If anyone has any ideas, or suggestions on tests I can do, that would be appreciated.

******************UPDATE********************

I think I have this all wrong. (just judging by the small size of my bundle) When I pack for iOS / Android, I believe the unity editor is switching platforms, as if I went to build setting -> switch platform, and re-compressing textures not packing them, then the asset bundle manager is taking from those files compressed for their respective platforms. It seems strange that it would have to do this for all assets. If anyone has insight on this I would be appreciative.

Update -> Switching platforms before building asset bundles for that platforms removes most all of the packing time, I'm assuming the above assertion is correct. Still looking for documentation