• Prefabs


    Prefabs

      Prefab is a type of asset -- a reusable GameObject stored in Project View. Prefabs can be inserted into any number of scenes, multiple times per scene. When you add a Prefab to a scene, you create an instance of it. All Prefab instances are linked to the original Prefab and are essentially clones of it. No matter how many instances exist in your project, when you make any changes to the Prefab you will see the change applied to all instances.

    Creating Prefabs

      In order to create a Prefab, simply drag a GameObject that you've created in the scene into the Project View. The GameObject's name will turn blue to show that it is a Prefab. You can rename your new Prefab.

      After you have performed these steps, the GameObject and all its children have been copied into the Prefab data. The Prefab can now be re-used in multiple instances. The original GameObject in the Hierarchy has now become an instance of the Prefab.

    Prefab Instances

      To create a Prefab instance in the current scene, drag the Prefab from the Project View into the Scene or Hierarchy View. This instance is linked to the Prefab, as displayed by the blue text used for their name in the Hierarchy View.

      

    • If you have selected a Prefab instance, and want to make a change that affects all instances, you can click the Select button in the Inspector to select the source Prefab.
  • 相关阅读:

    双向链表和环形链表(约瑟夫问题)
    单向链表的增删查改
    稀疏数组与环形数组
    离焦事件。这个坑谁抗的住呀,好无语呀
    maven
    maven工程运行出Unable to compile class for JSP: 错误
    笔记-JavaWeb学习之旅19
    获取redis cluster master对应的slot分布情况
    批量获取mysql数据库实例指定参数的值
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3536770.html
Copyright © 2020-2023  润新知