Unity Learning-Prefabrication (iv)

Source: Internet
Author: User

Prefabrication is cloning

For example, to simulate a rainy scene, the world fell off a one-raindrop. If we were to create an object for each raindrop at this point, it would be a waste of resources, and it would not be necessary, because all the raindrops were the same. This is the time to use a prefab, a type of game object resource that can be reused.

Add a prefab (Prefab)

First step: Add the Game object to be cloned

Step Two: Add
"Assets-create-prefab"

Step three: Pull Cube1 down muti.

Features of Prefab

The first step: add Muti to the hierarchy

When you click Muti, you can see that the game object has one more attribute in Inspector

Select: Prefab found in assets
Revert: Reset, cancel just the operation
Apply: Application, just-in-action application
Step two: Copy several muti
"Select Muti directly, then CTRL c/v, then move their position down"

Step Three:
Change the length of any one muti, then click Apply

It is found that changes in the properties of Prefab's game objects can affect the properties of other game objects copied through the Prefab object.

Unity Learning-Prefabrication (iv)

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.