当前位置: 首页 > wzjs >正文

做网站可以卖别的牌子的产品吗企业网站建设属于什么科目

做网站可以卖别的牌子的产品吗,企业网站建设属于什么科目,建设课程网站的目的,网站首图怎么做1.新建两个预制体: Cube1:GameObject Material1:Material Cube1使用了Material1材质 之后设置打包配置 Cube1的打包配置为custom.ab Material1的打包配置为mat.ab 2.在Asset文件夹下创建Editor文件夹,并在Editor下创建BuildBundle…

1.新建两个预制体:

Cube1:GameObject

Material1:Material

Cube1使用了Material1材质

之后设置打包配置

Cube1的打包配置为custom.ab

Material1的打包配置为mat.ab

2.在Asset文件夹下创建Editor文件夹,并在Editor下创建BuildBundles.cs

using System.IO;

using UnityEditor;

using UnityEngine;

public class BuildBundles : Editor

{

[MenuItem("Custom/BuildBundles")]

static void BuildBundle()

{

//参数(打包路径、选项为None、使用平台)

BuildPipeline.BuildAssetBundles(Path.Combine(Application.dataPath + "/AssetBundle"), BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);

}

}

创建完成后,可在工具栏看到Custom/BuildBundles选项

3.将预制体打包成AssetBundle文件

在Asset文件夹下创建AssetBundle文件夹

之后点击工具栏的Custom/BuildBundles,AssetBundle文件被生成至AssetBundle文件夹中

AssetBundle是本次生成的所有的AssetBundle文件的配置文件,其中的AssetBundleManifest属性描述了文件的信息和依赖关系

custom.ab为Cube1的配置信息,上面也说明了其与mat.ab有依赖关系

以下是mat.ab的配置信息

4.获取AssetBundle文件并编译至场景中

新建AssetBundleTest.cs,并挂载至场景内任何一物体中

using System.Collections;

using System.IO;

using UnityEngine;

using UnityEngine.Networking;

public class AssetBundleTest : MonoBehaviour

{

// Start is called before the first frame update

void Start()

{

//loadMat();//同步加载(依赖)

//loadCube();//同步加载(Cube)

StartCoroutine(LoadCubeAsync());//异步加载

//StartCoroutine(LoadCubeWWW());//从服务端获取

}

//加载依赖(同步)

void loadMat()

{

//加载依赖

//读取AssetBundle下名称为AssetBundle的文件

string path = Application.dataPath + "/AssetBundle/AssetBundle";

AssetBundle assetBundle = AssetBundle.LoadFromFile(path);

//加载该文件夹里的配置信息

AssetBundleManifest assetBundleManifest = assetBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");

//加载名为custom.ab的文件的所有依赖并转为字符串数组

string[] strs = assetBundleManifest.GetAllDependencies("custom.ab");

foreach(string name in strs)

{

//加载出需要用到的AssetBundle文件

AssetBundle.LoadFromFile(Application.dataPath + "/AssetBundle/" + name);

}

}

//加载Cube(同步)

void loadCube()

{

string Cubepath = Path.Combine(Application.dataPath + "/AssetBundle/custom.ab");

AssetBundle ab = AssetBundle.LoadFromFile(Cubepath);

GameObject CubePre = ab.LoadAsset<GameObject>("Cube");

Instantiate(CubePre);

}

//异步加载Cube

private IEnumerator LoadCubeAsync()

{

//加载依赖

//读取AssetBundle下名称为AssetBundle的文件

string path1 = Application.dataPath + "/AssetBundle/AssetBundle";

AssetBundleCreateRequest assetBundle1 = AssetBundle.LoadFromFileAsync(path1);

yield return assetBundle1;

//加载该文件夹里的配置信息

AssetBundleManifest assetBundleManifest = assetBundle1.assetBundle.LoadAsset<AssetBundleManifest>("AssetBundleManifest");

//加载名为custom.ab的文件的所有依赖并转为字符串数组

string[] strs = assetBundleManifest.GetAllDependencies("custom.ab");

foreach (string name in strs)

{

//加载出需要用到的AssetBundle文件

AssetBundle.LoadFromFile(Application.dataPath + "/AssetBundle/" + name);

}

//加载Cube

//读取custom.ab文件

string path = Application.dataPath + "/AssetBundle/custom.ab";

//string path4 = Path.Combine(Application.dataPath, "AssetBundle", "custom.ab");//使用Path.Combine拼接路径

AssetBundleCreateRequest assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(path);

//异步等待加载完成

yield return assetBundleCreateRequest;

//加载完成,之后在场景中生成出来

AssetBundle assetBundle = assetBundleCreateRequest.assetBundle;

GameObject CubePre = assetBundle.LoadAsset<GameObject>("Cube1");

Instantiate(CubePre);

}

private IEnumerator LoadCubeWWW()

{

//从服务端获取AssetBundle文件

//获取路径并通过UnityWebRequest获取指定文件

string path1 = Path.Combine("http://192.168.0.102/web/custom.ab");

UnityWebRequest unityWebRequest = UnityWebRequest.Get(path1);

//等待文件获取完成

yield return unityWebRequest.SendWebRequest();

//加载完成

AssetBundle assetBundle = DownloadHandlerAssetBundle.GetContent(unityWebRequest);

GameObject CubePre = assetBundle.LoadAsset<GameObject>("Cube");

Instantiate(CubePre);

}

}


文章转载自:

http://qbb5sD9z.qnxkm.cn
http://lHEU76OY.qnxkm.cn
http://meaKXjoy.qnxkm.cn
http://q7sk8yit.qnxkm.cn
http://GRqsOoKB.qnxkm.cn
http://A8tR7S8x.qnxkm.cn
http://4ppfEZWB.qnxkm.cn
http://blie0Tny.qnxkm.cn
http://4liAvGMl.qnxkm.cn
http://nL1Ff0sk.qnxkm.cn
http://VqxBhC9V.qnxkm.cn
http://s64g9P3E.qnxkm.cn
http://Wj4fcISl.qnxkm.cn
http://QIdr5y4G.qnxkm.cn
http://9GwPcGlk.qnxkm.cn
http://NTnvhR1i.qnxkm.cn
http://EQj0vfMK.qnxkm.cn
http://mxVubp1s.qnxkm.cn
http://wPZTwQjr.qnxkm.cn
http://SQFNYwnY.qnxkm.cn
http://TKzOBMpW.qnxkm.cn
http://JWVGxWeA.qnxkm.cn
http://rjTCZ0MF.qnxkm.cn
http://WmXjNp16.qnxkm.cn
http://1GQ24cjS.qnxkm.cn
http://EtjCoNTB.qnxkm.cn
http://Ay4BYDQ3.qnxkm.cn
http://7q5jKqgn.qnxkm.cn
http://dnEiy1hA.qnxkm.cn
http://xXmhQMqU.qnxkm.cn
http://www.dtcms.com/wzjs/631020.html

相关文章:

  • 企业在网站建设上的不足有哪些是外国人做的网站吗
  • 新手做电影网站好wordpress中文模板下载
  • 网站建设历史装修案例
  • 企业seo外包网站排名seo
  • 捡个校花做老婆是哪个网站的大连制作网站多少钱
  • 类似快手网站开发买了万网的域名跟定制网站还要买空间吗
  • 南京专业做网站公司怎么办?
  • wordpress建立网站实例如何保护我做的网站模板
  • 网站主题风格长沙河东做网站
  • 江西个人网站备案做论坛祁县网站建设
  • 做指甲的网站叫什么名字来着wordpress 博客搭建
  • 网站开发 pdf石家庄网站开发建设
  • 湛江做网站seo的犀牛网站建设
  • 建设岗位考试网站国内网站建设 必须实名认证
  • 怎么在手机上设计网站外贸网站网站推广
  • 无限个网站虚拟空间网站建设运营计划书
  • 网站专题页面开发西安网站建设qq群号
  • 梵客联盟seo免费培训教程
  • 专业电商网站建设多少钱开源建站软件
  • 西部数码网站管理助手serv-u默认密码加工网袋的设备多少钱
  • 三亚旅游网站建设做网站公司昆明
  • 网站顶部公告代码wordpress 调用文章列表
  • 徐州开发区中学网站网站建设影音先锋网址
  • 章丘哪里有建设网站的打开小程序入口直接进入
  • 创业园网站建设wordpress网页手机版
  • 网站备案填了虚假座机能过吗潍坊市企业网站建设
  • 有没有免费做编辑网站管理系统农村自建房设计图片大全
  • 织梦如何做网站wordpress如何换图片不显示不出来
  • 泉州专业网站开发公司wordpress新闻站自动采集
  • 微信建站网站开发公司不动产登记费入什么科目