版本:Unity 6 (6000.0)
语言简体中文
  • C#

BuildAssetBundleOptions.IgnoreTypeTreeChanges

建议更改

成功!

感谢您帮助我们提高 Unity 文档的质量。尽管我们不能接受所有提交,但我们确实会阅读用户提出的每条建议性更改,并在适用时进行更新。

关闭

提交失败

由于某些原因,您的建议更改未提交。请在几分钟后<a>重试</a>。感谢您抽出时间帮助我们提高 Unity 文档的质量。

关闭

取消

描述

在执行增量构建检查时忽略类型树更改。

这允许您在执行增量构建检查时忽略类型树更改。设置此标志后,如果已包含的资源未更改但类型树已更改,则不会重新构建目标 assetBundle。

//Create a folder (right click in the Assets folder and go to Create>Folder), and name it “Editor” if it doesn’t already exist
//Place this script in the Editor folder

//This script creates a new Menu named “Build Asset” and new options within the menu named “Normal” and “Ignore Type Tree Changes”. Click these menu items to build an AssetBundle into a folder with different options.

using UnityEngine; using UnityEditor;

public class Example { //Creates a new menu (Build Asset Bundles) and item (Normal) in the Editor [MenuItem("Build Asset Bundles/Normal")] static void BuildABsNone() { //Build AssetBundles with no special options //They will be written in the custom folder ("MyAssetBuilds") which needs to exist prior to this call. BuildPipeline.BuildAssetBundles("Assets/MyAssetBuilds", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSX); }

//Creates a new item (Ignore Type Tree Changes) in the new Build Asset Bundles menu [MenuItem("Build Asset Bundles/Ignore Type Tree Changes")] static void BuildABsDry() { //Build the AssetBundles in ignore type tree changes build mode BuildPipeline.BuildAssetBundles("Assets/MyAssetBuilds", BuildAssetBundleOptions.IgnoreTypeTreeChanges, BuildTarget.StandaloneOSX); } }