Unity3d resource load and release memory management

Source: Internet
Author: User

Unity3d There are three steps in the process of creating instances dynamically

Assetbundle.loadfromfile created is the Assetbundle file memory image bundle

Bundle. Loadasset is creating a asset memory image asset

Instantiate (asset) creates an instance object Gameobject

So it corresponds to the generation and release of these three generated objects.

Gameobject

Instantiate (asset) generates Gameobject

Destroy (Gameobject) Destroy Gameobject

Asset

Bundle. Loadasset creating a asset memory image

Reources.unloadasset (asset) Release asset memory image

Resources.unloadunusedassets () frees asset that are not referenced

(Policy, do not want to release the asset, keep the asset reference, call Unloadunusedassets to uniformly release the asset you want to release)

Bundle

Assetbundle.loadfromfile Creating a bundle file memory image

Bundle. Unload (FALSE) release bundle file memory image

(after all asset have been created, the bundle is called.) Unload (False))

Scene toggle destroys all gameobject, clears references to asset memory images, but does not include memory images of assetbundle files themselves

Unity3d resource load and release memory management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.