文档

Unity Engine

Unity Engine

RemoveComponent

Removes a component of type T from a given build profile.
阅读时间1 分钟最后更新于 14 天前

Definition

RemoveComponent<T>()

Removes a component of type
T
from a given build profile.
public void RemoveComponent<T>() where T : Object

Remarks

To make a build profile use the global Player settings, graphics settings, or quality levels again, remove its BuildProfilePlayerSettings, BuildProfileGraphicsSettings, or BuildProfileQualitySettings component. Unity destroys the removed object.
If you remove BuildProfilePlayerSettings from an active build profile, Unity recompiles scripts when the scripting define symbols change, and logs a warning for Player settings that only take effect after you restart the Editor.
Note: This method is restricted to ScriptableObject types and doesn't support all settings visible in the Build Profiles window.

RemoveComponent<T>(T)

Removes a component of type
T
from a given build profile.
public void RemoveComponent<T>(T objectToRemove) where T : Object

Parameters

objectToRemove

T
Specific instance to remove. Must already be part of the current profile.

Remarks

To make a build profile use the global Player settings, graphics settings, or quality levels again, remove its BuildProfilePlayerSettings, BuildProfileGraphicsSettings, or BuildProfileQualitySettings component. Unity destroys the removed object.
If you remove BuildProfilePlayerSettings from an active build profile, Unity recompiles scripts when the scripting define symbols change, and logs a warning for Player settings that only take effect after you restart the Editor.
Note: This method is restricted to ScriptableObject types and doesn't support all settings visible in the Build Profiles window.