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

南联做网站wordpress网页布局

南联做网站,wordpress网页布局,企业网站优化设计的含义,wordpress用闲聊一、创建Assetbundle 在unity3d开发的游戏中#xff0c;无论模型#xff0c;音频#xff0c;还是图片等#xff0c;我们都做成Prefab#xff0c;然后打包成Assetbundle#xff0c;方便我们后面的使用#xff0c;来达到资源的更新。 一个Assetbundle可以打包一个模型无论模型音频还是图片等我们都做成Prefab然后打包成Assetbundle方便我们后面的使用来达到资源的更新。 一个Assetbundle可以打包一个模型这里的模型不单单指的是预制模型可以是Project视图下的任何东西也可以是多个模型但两种打包方式占用的空间不一样。 比如我打包三个一样的模型只不过他们的脚本不一样创建三个空的GameObject(One,Two,Three)分别挂载脚本One,Two,Three。如果我为每个模型单独打包生成One,Two,Three三个Assetbundle其所占的空间是ABC但是ABC ! D.由此可知想通的资源尽可能的打包到一起他们共用一套资源。不相同的模型尽量分开打包。 二、分开打包注意这个脚本必须放在Editor文件夹内Editor文件夹没有的话需自己创建 [csharp] view plaincopy print? /// summary   /// 将选中的预制分别打包   /// /summary   [MenuItem(AssetBundleDemo/Create AssetBundles By themselves)]   static void CreateAssetBundleThemelves(){       //获取要打包的对象在Project视图中       Object[] selects  Selection.GetFiltered (typeof(Object),SelectionMode.DeepAssets);       //遍历选中的对象       foreach(Object obj in selects){           //这里建立一个本地测试           //注意本地测试中可以是任意的文件但是到了移动平台只能读取路径StreamingAssets里面的           //StreamingAssets是只读路径不能写入           string targetPath  Application.dataPath  /AssetBundleLearn/StreamingAssets/  obj.name  .assetbundle;//文件的后缀名是assetbundle和unity都可以           if(BuildPipeline.BuildAssetBundle(obj,null,targetPath,BuildAssetBundleOptions.CollectDependencies)){                  Debug.Log(obj.name  is packed successfully!);           }else{               Debug.Log(obj.name  is packed failly!);           }       }       //刷新编辑器不写的话要手动刷新,否则打包的资源不能及时在Project视图内显示       AssetDatabase.Refresh ();   }   SelectionMode.DeepAssets 这个选择模式意味着如果选择中包含多个文件那么他将包含这个文件视图中的所有资源。 他还有其他的各种选项以下是官方文档 SelectionMode Description SelectionMode can be used to tweak the selection returned by Selection.GetTransforms. The default transform selection mode is: SelectionMode.TopLevel | SelectionMode.ExcludePrefab | SelectionMode.Editable. UnfilteredReturn the whole selection.TopLevelOnly return the topmost selected transform. A selected child of another selected transform will be filtered out.DeepReturn the selection and all child transforms of the selection.ExcludePrefabExcludes any prefabs from the selection.EditableExcludes any objects which shall not be modified.AssetsOnly return objects that are assets in the Asset directory.DeepAssetsIf the selection contains folders, also include all assets and subfolders within that folder in the file hierarchy. 最核心的方法BuildPipeline.BuildAssetBundle (obj, null, targetPath, BuildAssetBundleOptions.CollectDependencies) 参数1它只能放一个对象因为我们这里是分别打包所以通过循环将每个对象分别放在了这里。 参数2可以放入一个数组对象。 参数3要打包到的路径 参数4默认情况下打的包只能在电脑上用如果要在手机上用就要添加一个参数。 Android上 BuildPipeline.BuildAssetBundle (obj, null, targetPath, BuildAssetBundleOptions.CollectDependencies,BuildTarget.Android) IOS上: BuildPipeline.BuildAssetBundle (obj, null, targetPath, BuildAssetBundleOptions.CollectDependencies,BuildTarget.iPhone) 另外电脑上和手机上打出来的Assetbundle不能混用不同平台只能用自己的。 三、一起打包 [csharp] view plaincopy print? /// summary   /// 将选中的预制打包到一起   /// /summary   [MenuItem(AssetBundleDemo/Create AssetBundles Together)]   static void CreateAssetBundleTogether(){       //要打包的对象       Object[] selects  Selection.GetFiltered (typeof(Object),SelectionMode.DeepAssets);       //要打包到的路径       string targetPath  Application.dataPath  /AssetBundleLearn/StreamingAssets/Together.assetbundle;       if(BuildPipeline.BuildAssetBundle(null,selects,targetPath,BuildAssetBundleOptions.CollectDependencies)){           Debug.Log(Packed successfully!);          }else{           Debug.Log(Packed failly!);       }       //刷新编辑器不写的话要手动刷新       AssetDatabase.Refresh ();   }   四、读取 [csharp] view plaincopy print? using UnityEngine;   using System.Collections;      public class ReanAssetbundle : MonoBehaviour {          //不同平台下StreamingAssets的路径是不同的这里需要注意一下。       public static readonly string m_PathURL            #if UNITY_ANDROID           jar:file://  Application.dataPath  !/assets/;           #elif UNITY_IPHONE           Application.dataPath  /Raw/;           #elif UNITY_STANDALONE_WIN || UNITY_EDITOR           file://  Application.dataPath  /AssetBundleLearn/StreamingAssets/;           #else           string.Empty;           #endif          void OnGUI(){           if(GUILayout.Button(加载分开打包的Assetbundle)){               StartCoroutine(LoadGameObjectPackedByThemselves(m_PathURL  One.assetbundle));               StartCoroutine(LoadGameObjectPackedByThemselves(m_PathURL   Two.assetbundle));               StartCoroutine(LoadGameObjectPackedByThemselves(m_PathURL  Three.assetbundle));              }                      if(GUILayout.Button(加载打包在一起的Assetbundle)){               StartCoroutine(LoadGameObjectPackedTogether(m_PathURL  Together.assetbundle));           }                  }       //单独读取资源       private IEnumerator LoadGameObjectPackedByThemselves(string path){           WWW bundle  new WWW (path);           yield return bundle;              //加载           yield return Instantiate (bundle.assetBundle.mainAsset);           bundle.assetBundle.Unload (false);       }          IEnumerator  LoadGameObjectPackedTogether (string path)       {           WWW bundle  new WWW (path);           yield return bundle;              Object one  bundle.assetBundle.Load (One);           Object two  bundle.assetBundle.Load (Two);           Object three  bundle.assetBundle.Load (Three);              //加载           yield return Instantiate (one);           yield return Instantiate (two);           yield return Instantiate (three);           bundle.assetBundle.Unload (false);       }   }
http://www.pierceye.com/news/766268/

相关文章:

  • 长治做网站哪家好赣州注册公司
  • 网站开发从入门到精通做h5的网站哪个好
  • 免费公司网站如何建立设计个人网站好备案吗
  • 建网站和做微信哪个好在线识别图片百度识图
  • php网站开发如何实现删除功能大连大连建设工程信息网站
  • 表格模板免费下载网站wordpress 插件位置
  • wordpress小白能学会吗汕头做网站优化公司
  • 军队营房基础建设网站重庆做网站个人
  • 网站建设怎样中英文网站备案是空间备案还是域名备案
  • 陕西网站制作人力资源服务外包
  • 成都网站建设哪家售后好网站建设费可以计业务费吗
  • 做服装到哪个网站拿货品质好自己制作的网页别人如何访问
  • 榆林哪里做网站网页游戏网站那个好
  • 泰安口碑好的企业建站公司wordpress验证码无效
  • 圣矢网络重庆网站建设优化推广公司好听好记的网站域名
  • 如何做旅游小视频网站比较好的外贸公司
  • 图书馆建设投稿网站使用 ahrefs 进行 seo 分析
  • 校园网站建设 德育免费换ip软件
  • 排行网站模板凡科代理千万不要做
  • 贵州省冶金建设有限公司网站网站好玩新功能
  • 怎么让客户做网站惠州关键词排名提升
  • 创建公司网站需要什么国外的智慧城市建设网站
  • 阿里云服务器做网站django高清无版权网站
  • 网页制作与网站制作wordpress二次元风格
  • 贵州省城乡建设局网签网站工业设计网站有那些
  • 网站 电信已备案 联通泗阳做网站设计
  • 胶州做淘宝的网站龙南黄页全部电话
  • 可以看网站的手机浏览器藁城住房和城乡建设局网站
  • 关于网站制作的指标哪家公司网站做的比较好
  • 网站开发一般多少钱规划设计公司毛利