怎样推算排列三的和值:buildpipeline.buildassetbundleexplicitassetnames 编译资源包带有资源名

排列三2014079期正版藏机图 www.d0po.cn 2015-1-3 22:07| 发布者: 杨炎| 查看: 2439| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: buildpipeline.buildassetbundleexplicitassetnames 编译资源包带有资源名static functionbuildassetbundleexplicitassetnames(assets:object,assetnames: string,pathname: string,options:buildassetbundleoptions ...

buildpipeline.buildassetbundle" target="_blank" class="relatedlink">assetbundleexplicitassetnames 编译资源包带有资源名

static functionbuildassetbundleexplicitassetnames(assets:object[],assetnames: string[],pathname: string,options:buildassetbundleoptions=buildassetbundleoptions.collectdependencies|buildassetbundleoptions.completeassets,targetplatform:buildtarget=buildtarget.webplayer) : bool

description描述

builds an asset bundle, with custom names for the assets (unity pro only).

生成一个资源包,带有资源的自定义名称(仅用于unity pro)。

creates a compressed 排列三2014079期正版藏机图 file that contains a collection of assets. assetbundles can contain any asset found in the project folder. in the assetnames parameter, supply an array of strings of the same size as the number of assets. these will be used as asset names, which you can then pass tobuildassetbundleto just use the asset's path names instead. the compressed asset bundle file will be saved at pathname. options allows you to automatically include dependencies or always include complete assets instead of just the exact referenced objects.

创建一个压缩的unity3d文件,包含资源的集合。资源包可以包含任何项目文件中的资源。在assetnames参数,然后可以传递给assetbundle.load加载一个特定的资源。使用buildassetbundle只使用资源的路径名替代。压缩的资源包文件将保持在pathname。options允许您自动包括依赖关系或总是包含完整的资源,而不只是准确引用的对象。

参见:buildassetbundle,assetbundle类,www.assetbundle.

// c# example

// builds an asset bundle from the selected folder in the project view.

// bare in mind that this script doesnt track dependencies nor is recursive

//在项目视图从选择的文件夹生成资源包

//记住,这个脚本不跟踪依赖关系,也不是递归

using unityengine;

using unityeditor;

using system.io;

public class buildassetbundlesfromdirectory {

[@menuitem("asset/build assetbundles from directory of files")]

static void exportassetbundles () {

// get the selected directory

//获取选择的目录

string path = assetdatabase.getassetpath(selection.activeobject);

debug.log("selected folder: " + path);

if (path.length != 0) {

path = path.replace("assets/", "");

string [] fileentries = directory.getfiles(application.datapath+"/"+path);

foreach(string filename in fileentries) {

string filepath = filename.replace("", "/");

int index = filepath.lastindexof("/");

filepath = filepath.substring(index);

debug.log(filepath);

string localpath = "assets/" + path;

if (index > 0)

localpath += filepath;

object t = assetdatabase.loadmainassetatpath(localpath);

if (t != null) {

debug.log(t.name);

string bundlepath = "assets/" + path + "/" + t.name + ".unity3d";

debug.log("building bundle at: " + bundlepath);

// build the resource file from the active selection.

//从激活的选择编译资源文件

buildpipeline.buildassetbundle

(t, null, bundlepath, buildassetbundleoptions.completeassets);

}

}

}

}

}

相关阅读

文章点评
相关文章
  • 紫光阁中共中央国家机关工作委员会 2019-04-24
  • 图解:习近平主席这12个金句振奋人心! 2019-04-24
  • 您访问的页面找不回来了 2019-04-07
  • 五莲科技局以“三大”助力动能转换 2019-04-07
  • 匹夫有责之一百一十二—道义大义的博客—强国博客—人民网 2019-03-30
  • 守住青山不放松 护好绿水不辞难——在渝全国人大代表聚焦“共抓大保护、不搞大开发”专题调研记略 2019-03-28
  • 经营者要想“我心换你心”,就要未雨绸缪,让不诚信的诱惑少一点,如此才能在市场中生存下来。反过来说,承担不起亏损就关门歇业,是否也是一种不诚信呢? 2019-03-21
  • 追风上市公司“跌落神坛”-热门标签-华商网数码 2019-03-21
  • 文化艺术交易场所沙龙第一期活动在京顺利举行 2019-03-16
  • 看把你高兴的屁颠屁颠的,光有赞有什么用?我给你个货真价实的 [大红包]。 2019-03-16
  • 候选企业:中国石油呼和浩特石化公司 2019-02-22
  • 我国纳米核心技术取得重大突破 2019-02-22
  • 北京:端午节民俗地图  小枣粽——竹叶红枣糯糯情  2019-01-26
  • 机器人送快递将在西安试点 识别红绿灯还能“车让人” 2019-01-26
  • 首批限竞房正式入市 戳三大盘看详情! ——凤凰网房产北京 2018-12-09
  • 364| 507| 612| 273| 57| 865| 128| 72| 514| 938|