Documentation

Unity Engine

Download Unity

Unity Engine

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.
Read time 1 minuteLast updated 15 days ago

Definition

public void AddComponent<T>(T objectToAdd) where T : Object

Parameters

objectToAdd

T
ScriptableObject instance to add.

Remarks

If you pass a BuildProfilePlayerSettings instance, this method throws a
NotSupportedException
. If you pass a BuildProfileGraphicsSettings or BuildProfileQualitySettings instance, this method throws an
ArgumentException
.
Note: This method is restricted to ScriptableObject types and doesn't support all settings visible in the Build Profiles window.