AddComponent<T>(T)
Adds a ScriptableObject to the build profile as a sub-asset. Only one instance per type can be embedded within a build profile.
阅读时间1 分钟最后更新于 14 天前
Definition
- Type: Method
- Namespace: UnityEditor.Build.Profile
- Assembly: UnityEditor.CoreModule
public void AddComponent<T>(T objectToAdd) where T : Object
Parameters
ScriptableObject instance to add.
Remarks
This method doesn't accept BuildProfilePlayerSettings, BuildProfileGraphicsSettings, or BuildProfileQualitySettings. To add these settings, use BuildProfile.CreateComponent.
If you pass a BuildProfilePlayerSettings instance, this method throws a . If you pass a BuildProfileGraphicsSettings or BuildProfileQualitySettings instance, this method throws an .
NotSupportedExceptionArgumentExceptionNote: This method is restricted to ScriptableObject types and doesn't support all settings visible in the Build Profiles window.