docs.unity3d.com
    显示 / 隐藏目录

    Class ScalableSetting<T>

    Define the level's value for a ScalableSettingValue<T>.

    Use this setting in an asset that defines the quality settings for a specific platform. Then those settings can be used with the ScalableSettingValue<T> to get the actual value to use.

    If you intend to serialize this type, use specialized version instead. (IntScalableSetting).

    Inheritance
    Object
    ScalableSetting<T>
    BoolScalableSetting
    FloatScalableSetting
    IntScalableSetting
    RenderPipelineSettings.PlanarReflectionAtlasResolutionScalableSetting
    UintScalableSetting
    Namespace: UnityEngine.Rendering.HighDefinition
    Syntax
    [Serializable]
    public class ScalableSetting<T> : ISerializationCallbackReceiver
    Type Parameters
    Name Description
    T

    The type of the scalable setting.

    Constructors

    ScalableSetting(T[], ScalableSettingSchemaId)

    Build a new scalable setting.

    Declaration
    public ScalableSetting(T[] values, ScalableSettingSchemaId schemaId)
    Parameters
    Type Name Description
    T[] values

    The values of the scalable setting. Must not be null.

    ScalableSettingSchemaId schemaId

    The of the schema for this scalable setting.

    Properties

    Item[Int32]

    Get the value for a specific level.

    Declaration
    public T this[int index] { get; }
    Parameters
    Type Name Description
    Int32 index

    The index of the value to get.

    Property Value
    Type Description
    T

    If the index is in the range of the contained values, the associated value will be returned. Otherwise, default is returned.

    schemaId

    The schema id of this scalable setting.

    Declaration
    public ScalableSettingSchemaId schemaId { get; set; }
    Property Value
    Type Description
    ScalableSettingSchemaId

    Methods

    TryGet(Int32, out T)

    Get the value of the level index.

    Declaration
    public bool TryGet(int index, out T value)
    Parameters
    Type Name Description
    Int32 index

    The index of the level to get.

    T value

    Contains the value of the level when the level is found.

    default when:

    • The index is out of range
    Returns
    Type Description
    Boolean

    true when the value was evaluated, false when the value could not be evaluated.

    Explicit Interface Implementations

    ISerializationCallbackReceiver.OnAfterDeserialize()

    Serialization callback

    Declaration
    void ISerializationCallbackReceiver.OnAfterDeserialize()
    Implements
    ISerializationCallbackReceiver.OnAfterDeserialize()

    ISerializationCallbackReceiver.OnBeforeSerialize()

    Serialization callback

    Declaration
    void ISerializationCallbackReceiver.OnBeforeSerialize()
    Implements
    ISerializationCallbackReceiver.OnBeforeSerialize()
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)