天天看點

A guide to AssetBundles and Resources AssetBundles與Resources的指南 最佳實踐系列2

A guide to AssetBundles and Resources AssetBundles與Resources的指南

本文檔主要是對Unity官方手冊的個人了解與總結(其實以翻譯記錄為主:>)

僅作為個人學習使用,不得作為商業用途,歡迎轉載,并請注明出處。

文章中涉及到的操作都是基于Unity2018.3版本

參考連結:https://unity3d.com/cn/learn/tutorials/topics/best-practices/guide-assetbundles-and-resources?playlist=30089

This is a series of articles that provides an in-depth discussion of Assets and resource management in the Unity engine. It seeks to provide expert developers with deep, source-level knowledge of Unity’s Asset and serialization systems. It examines both the technical underpinnings of Unity’s AssetBundle system and the current best practices for employing them.

這是一個系列文章,提供了對Unity引擎中的Assets 和resource 管理的深入讨論。它嘗試為專業開發人員提供關于Unity資産和序列化系統深入的、源代碼級的知識。它考察了Unity的AssetBundle 系統的技術基礎和目前使用它們的最佳實踐。

The guide is broken down into four chapters:該指南分為四章:

  1. Assets, Objects and serialization discusses the low-level details of how Unity serializes Assets and handles references between Assets. It is strongly recommended that readers begin with this chapter as it defines terminology used throughout the guide.

    資産、對象和序列化讨論了Unity如何序列化資産和處理資産之間引用的底層細節。強烈建議讀者從本章開始,因為它定義了貫穿指南的術語。

  2. The Resources folder discusses the built-in Resources API.

    Resources檔案夾讨論了内置的Resources API。

  3. AssetBundle fundamentals builds on the information in chapter 1 to describe how AssetBundles operate, and discusses both the loading of AssetBundles and the loading of Assets from AssetBundles.

    AssetBundle 基礎知識建立在第1章描述AssetBundles 如何操作的資訊之上,并讨論了AssetBundles 的加載和AssetBundles 中資産的加載。

  4. AssetBundle usage patterns is a long article discussing many of the topics surrounding the practical uses of AssetBundles. It includes sections on assigning Assets to AssetBundles and on managing loaded Assets, and describes many common pitfalls encountered by developers using AssetBundles.

    AssetBundle 使用模式是一篇很長的文章,讨論了圍繞AssetBundles實際使用的許多主題。它包括關于将資産配置設定給AssetBundles 和管理加載的資産的部分,并描述了使用資産包的開發人員遇到的許多常見陷阱。

Note: This guide’s terms for Objects and Assets differ from Unity’s public API naming conventions.

注意:本指南中對象和資産的術語與Unity的公共API命名約定不同。

The data this guide calls Objects are called Assets in many public Unity APIs, such as AssetBundle.LoadAsset and Resources.UnloadUnusedAssets. The files this guide calls Assets are rarely exposed to any public APIs. When they are exposed, it is generally only in build-related code, such as AssetDatabase and BuildPipeline. In these cases, they are called files in public APIs.

本指南稱的對象(Objects) 在許多公共Unity APIs中被稱為資産,比如AssetBundle.LoadAsset 與Resources.UnloadUnusedAssets。本指南稱的資産(Assets) 很少曝露給任何公共APIs。當它們被公開時,通常隻在與建構相關的代碼中,如AssetDatabase和BuildPipeline中。在這些情況下,它們在公共APIs中稱為檔案。

繼續閱讀