ドキュメント

Unity Engine

Download Unity

Unity Engine

FloatProperty

Draws a field for a float shader property, using automatic layout.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

FloatProperty(MaterialProperty, string)

Draws a field for a float shader property, using automatic layout.
public float FloatProperty(MaterialProperty prop, string label)

Parameters

The material property to edit.

label

The label to show for the property.

Returns

Type

Description

floatThe value of the property, which might have changed if the user interacted with the control.

Remarks

Use this method in a custom material editor to draw a field for a float shader property. This overload uses automatic layout. To set the position and size of the control, use the overload that takes a Rect.

FloatProperty(Rect, MaterialProperty, string)

Draws a field for a float shader property at a specified position.
public float FloatProperty(Rect position, MaterialProperty prop, string label)

Parameters

position

The position and size of the control.

The material property to edit.

label

The label to show for the property.

Returns

Type

Description

floatThe value of the property, which might have changed if the user interacted with the control.

Remarks

Use this method in a custom material editor to draw a field for a float shader property. This overload draws the control at
position
. To use automatic layout, use the overload without a Rect.

FloatProperty(string, string)

Draw a property field for a float shader property, specified by name.
注意
Deprecated. Use FloatProperty with MaterialProperty instead.
public float FloatProperty(string propertyName, string label)

Parameters

propertyName

The name of the shader property.

label

Label for the property.

Returns

Type

Description

floatThe value of the property, which might have been changed by the user interacting with the control.

Remarks

This overload is obsolete. Use MaterialEditor.FloatProperty(MaterialProperty, string) instead.