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

    Class ColorPreset

    Object that contains a list of predefined colors and parameters to generate more colors.

    Inheritance
    Object
    Object
    ScriptableObject
    ColorPreset
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.MARS
    Syntax
    [CreateAssetMenu(fileName = "ColorPreset", menuName = "MARS/ColorPreset")]
    public class ColorPreset : ScriptableObject

    Methods

    GetColor(Int32)

    Gets the color for a given index. This will choose from the predefined list or generate a color based on the index.

    Declaration
    public Color GetColor(int colorIndex)
    Parameters
    Type Name Description
    Int32 colorIndex

    The index into the list of predefined colors. If greater than the list length, it will be the index into the procedural color generation.

    Returns
    Type Description
    Color

    A new color from this preset.

    GetNewSaturation(Int32)

    Generate a saturation (HSV) in the defined range

    Declaration
    public float GetNewSaturation(int index)
    Parameters
    Type Name Description
    Int32 index

    Index into the sequence

    Returns
    Type Description
    Single

    Saturation value from 0 to 1

    GetNewValue(Int32)

    Generate a value (HSV) in the defined color range

    Declaration
    public float GetNewValue(int index)
    Parameters
    Type Name Description
    Int32 index

    Index into the sequence

    Returns
    Type Description
    Single

    Value from 0 to 1

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