Const OptimizationPolicy
OptimizationPolicy: { AUTO: number; MULTI_INSTANCE: number; SINGLE_INSTANCE: number } = Enum({/*** @en The optimization policy is automatically chosen based on the number of instantiations.* When you first create an instance, the behavior is the same as SINGLE_INSTANCE.* MULTI_INSTANCE will be automatically used after multiple creation.* @zh 根据创建次数自动调整优化策略。初次创建实例时,行为等同 SINGLE_INSTANCE,多次创建后将自动采用 MULTI_INSTANCE。*/AUTO: 0,/*** @en Optimize for single instance creation.<br>* This option skips code generation for this prefab.* When this prefab will usually create only one instances, please select this option.* @zh 优化单次创建性能。<br>* 该选项会跳过针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般只会创建一个实例时,请选择此项。*/SINGLE_INSTANCE: 1,/*** @en Optimize for creating instances multiple times.<br>* This option enables code generation for this prefab.* When this prefab will usually create multiple instances, please select this option.* It is also recommended to select this option if the prefab instance in the scene has Auto Sync enabled and there are multiple instances in the scene.* @zh 优化多次创建性能。<br>* 该选项会启用针对这个 prefab 的代码生成优化操作。当该 prefab 加载后,一般会创建多个实例时,请选择此项。如果该 prefab 在场景中的节点启用了自动关联,并且在场景中有多份实例,也建议选择此项。*/MULTI_INSTANCE: 2,})
Type declaration
-
AUTO: number
-
MULTI_INSTANCE: number
-
SINGLE_INSTANCE: number
null or the error info
the created node or null