/// <summary> /// <para>Enables GPU instancing and disables Unity renderers for the given prefab instance without re-adding it to the list of registerd prefabs.</para> /// <para>Use this if you want to unpause GPU Instancing for a prefab.</para> /// <para>Note that the prefab must be enabled for runtime modifications in the manager in order for this to work (for performance reasons).</para> /// <para>Also note that you can also add <seealso cref="GPUInstancerModificationCollider"/> to a game object to use its collider to automatically /// enable/disable instancing when a prefab instance enters/exits its collider.</para> /// </summary> /// <param name="manager">The manager that defines the prototypes you want to GPU instance.</param> /// <param name="prefabInstance">The prefab instance to enable the GPU Instancing of.</param> /// <param name="disableMeshRenderers">If set to false Mesh Renderer components will not be disabled after enabling instancing. Should be used only for instances /// that have already disabled mesh renderers to speed up the process.</param> public static void EnableInstancingForInstance(GPUInstancerPrefabManager manager, GPUInstancerPrefab prefabInstance, bool setRenderersDisabled = true) { manager.EnableInstancingForInstance(prefabInstance, setRenderersDisabled); }
/// <summary> /// <para>Enables GPU instancing and disables Unity renderers for the given prefab instance without re-adding it to the list of registerd prefabs.</para> /// <para>Use this if you want to unpause GPU Instancing for a prefab.</para> /// <para>Note that the prefab must be enabled for runtime modifications in the manager in order for this to work (for performance reasons).</para> /// <para>Also note that you can also add <seealso cref="GPUInstancerModificationCollider"/> to a game object to use its collider to automatically /// enable/disable instancing when a prefab instance enters/exits its collider.</para> /// </summary> /// <param name="manager">The manager that defines the prototypes you want to GPU instance.</param> /// <param name="prefabInstance">The prefab instance to enable the GPU Instancing of.</param> public static void EnableInstancingForInstance(GPUInstancerPrefabManager manager, GPUInstancerPrefab prefabInstance) { manager.EnableInstancingForInstance(prefabInstance); }