博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Unity 分场景打包
阅读量:6950 次
发布时间:2019-06-27

本文共 1588 字,大约阅读时间需要 5 分钟。

分场景打包步骤:导入unity中AB包后

  1: 指定场景
  2: 指定abname
  3: 指定objinabname
  4: 协同
  5: 委托 void string

unity

先引入命名空间  using LLWHABFW;

using System.Collections;using System.Collections.Generic;using UnityEngine;using LLWHABFW;using UnityEngine.SceneManagement;public class S3LoadAB : MonoBehaviour {    private string _abScence = "scenes03";//指定场景 //小写s    private string _aBName = "scenes03/scenes03.ab";  //指定abName    private string _objInAB01 = "Plane.prefab";//指定objIn abName    private string _objInAB02 = "RollerBall.prefab";//指定objInabName    private List
_list; // Use this for initialization void Start () { _list = new List
(); StartCoroutine(AssetBundleMgr.GetInstance().LoadAssetBundlePack(_abScence, _aBName, XXXX));//协同 } // Update is called once per frame void Update () { if (Input.GetKeyDown(KeyCode.Space)) //销毁资源 { for (int i = 0; i < _list.Count; i++) { Destroy(_list[i]); } _list.Clear(); AssetBundleMgr.GetInstance().DisposeAllAssets(_abScence); SceneManager.LoadScene("1"); } } private void XXXX(string LLwh) //void string { GameObject Plane, Ball; Plane = AssetBundleMgr.GetInstance().LoadAsset(_abScence, _aBName, _objInAB01, false) as GameObject; Ball = AssetBundleMgr.GetInstance().LoadAsset(_abScence, _aBName, _objInAB02, false) as GameObject; _list.Add(Instantiate(Plane)); _list.Add(Instantiate(Ball)); }}

 

 

 

转载于:https://www.cnblogs.com/lk95/p/9929235.html

你可能感兴趣的文章
循环、函数、数组、传值、输出方式。基础
查看>>
Mysql 基础知识
查看>>
1)⑤爬取搜狗旅游部分新闻
查看>>
ubuntu 下 apache2 查看 已加载的模块 命令
查看>>
poj——3349 哈希加模拟
查看>>
Vue入门1
查看>>
文字转语音软件哪个好,这一款值得推荐
查看>>
Windows Server 2012的服务管理自动化
查看>>
XML的解析
查看>>
Starting MySQL. ERROR! The server quit without updating PID file
查看>>
我的友情链接
查看>>
tomcat启动脚本
查看>>
对于新旧技术的争论,我很low的想法
查看>>
我的友情链接
查看>>
RPM包定制-实战
查看>>
Apache编译注释(二)
查看>>
轻松搭建Windows8云平台开发环境
查看>>
经典SQL语句大全
查看>>
再续2014年网页设计趋势
查看>>
github使用介绍
查看>>