文档

Unity Engine

Unity Engine

CreateComponent<T>()

Creates a new instance of a given scriptable object and adds it as a sub-asset to the build profile. Only one instance per type can be embedded within a build profile.
阅读时间1 分钟最后更新于 1 天前

Definition

public T CreateComponent<T>() where T : Object

Returns

Type

Description

TScriptableObject type to instantiate.

Remarks

Use this method to add BuildProfileGraphicsSettings or BuildProfileQualitySettings to a build profile. Unity initializes these settings with the current global graphics settings, or with the global quality levels for the build profile's platform.
Note: This method is restricted to ScriptableObject types and doesn't support all settings visible in the Build Profiles window. To create PlayerSettings, use the Build Profiles window.