Several ways for Unity to dynamically load resources

Several ways to load Unity resources:

instantiate: The simplest way to dynamically generate an object by instantiation.

Assetsbundle: put the resource into an asset bundle and put it on the server or local disk, then use the WWW module to get it, and then load an object from this bundle. The official recommendation of unity is also a method used by most commercial projects.

AssetDatabase.loadasset : This method is only valid within the scope of the editor. There is no such function when the game is running, and it is usually used for debugging during development.

Resource.Load: You can directly load and return a certain type of Object. The premise is to put this resource in the folder named Resource. Unity will put all of it into the installation package regardless of whether there is a scene reference.

Guess you like

Origin blog.csdn.net/Abel02/article/details/87861285