Asset Workflow

Asset Panel

image-20240319102237183

The asset panel is an important panel in the editor that helps you manage all the assets used in the scene. In the asset panel, you can view and manage all the assets used in the scene, such as materials, textures, models, etc. Through the asset panel, you can add or delete assets, as well as categorize them for better organization.

Currently, the editor supports the following uploaded or created assets (+ indicates composite files):

Supported AssetsDescriptionExchange FormatCreation Method
FolderSimilar to operating system folders, you can drag files into the folderCreate
SceneUsed for entity tree managementCreate
Model3D model files.gltf+.bin+.jpg, .glb+.jpg, .fbx+.jpgUpload
MeshCannot be added, only internal meshes and meshes in models can be used-
MaterialUsed to adjust rendering effectsCreate
TextureUpload image files to create 2D textures.png,.jpg, .webpUpload
Cube Texture (TextureCube)Used for scene sky and ambient light.hdrUpload
SpriteYou can directly upload image files to create sprites (skipping the step of creating a sprite and then binding a texture).png,.jpg, .webpCreate/Upload
Sprite AtlasPacks multiple sprites into an atlas for optimizing 2D assetsCreate
FontUsed to create 2D text.ttf, .otf, .woffUpload
ScriptUsed to write business logic.tsCreate
AnimatorControllerUsed to organize animation clips and control animation statesCreate
AnimationClipPre-made, continuous animation data containing keyframe changes over a period of time.tsCreate
StateMachineScriptProgram script used to control and manage animation state machine behaviorCreate
LottieSupports lottie file uploads.json(+.jpg), images support base64 embedded and standalone imagesUpload
SpineSupports spine file uploads.json + .atlas + .jpgUpload

Adding Assets

To add assets to the scene, you can click the add button on the asset panel or use the add option in the right-click menu of the asset panel to add new assets. After adding assets, you can edit the properties of the assets in the Inspector Panel. The asset types in the asset panel are very rich, such as materials, textures, models, fonts, etc. Refer to the table above for details.

image-20240319103341208

You can also drag files into the asset panel to add assets. For multiple files, you can select and drag them into the asset panel together.

drag6

Organizing Assets

Assets in the asset panel can be managed by categorization for better organization. You can create folders in the asset panel and move assets into the corresponding folders (you can also move them into folders in the left directory) to achieve categorized management. Folders in the asset panel can be nested, allowing you to create multi-level folders for better organization of assets.

drag7

The asset panel provides a user-friendly toolbar for browsing assets, helping you quickly find a specific asset or type of asset. You can also modify the browsing mode, sorting method, and thumbnail size of assets according to your usage habits.

drag8

After organizing the assets, each asset has a relative path. You can right-click an asset to copy its path.

image-20240319132804611

This is important for project development because projects often need to load assets asynchronously, meaning that certain assets (or even scenes) do not need to be loaded during initialization. You can control the loading of an asset through scripts. For specific syntax, refer to the usage of Assets and Scenes. For example, to load a scene:

this.engine.resourceManager.load({ url: "...", type: AssetType.Scene });

Deleting Assets

You can delete an asset by selecting it and clicking the delete button on the asset panel or using the delete option in the right-click menu. When deleting assets, you need to be aware of whether the deleted asset will affect the association of other nodes in the scene.

Copying and Pasting Assets

You can right-click an asset in the asset panel to copy it, then paste it into the folder you entered:

![2024-07-19 14.18.11](https://mdn.alipayobjects.com/rms/afts/img/A*0Wf5T6tEvnYAAAAAAAAAAAAAARQnAQ/original/2024-07-19 14.18.11.gif)

You can also use + C and + V operations.

Previewing Assets

After selecting an asset, the Inspector Panel on the right will display the configurable properties of the asset. The configurable items corresponding to different assets are different. For example, glTF assets will display a model preview window, and material assets will display detailed material configuration options.

image-20240319120017637

Using Assets

部分资产(如 glTF 资产)支持拖拽到场景中或节点树中。

drag9

Shortcuts

ShortcutFunction
/ DeleteDelete asset
+ DDuplicate asset
+ FSearch asset
+ CCopy asset
+ VPaste asset

Was this page helpful?