文档

Unity Engine

Download Unity

Unity Engine

OnGUI

Draws a custom GUI for the property with a label that can include a tooltip and an icon.
阅读时间1 分钟最后更新于 21 天前

Definition

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

OnGUI(Rect, MaterialProperty, GUIContent, MaterialEditor)

Draws a custom GUI for the property with a label that can include a tooltip and an icon.
public virtual void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)

Parameters

position

Rectangle on the screen to use for the property GUI.

The MaterialProperty to make the custom GUI for.

The label of this property, as a GUIContent.

Current material editor.

Remarks

Override this overload to use the full label content, including its tooltip and icon. By default, it passes only the label text to the overload that takes a string label. If you override neither overload, the drawer shows "No GUI Implemented".

OnGUI(Rect, MaterialProperty, string, MaterialEditor)

Override this method to make your own GUI for the property.
public virtual void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor editor)

Parameters

position

Rectangle on the screen to use for the property GUI.

The MaterialProperty to make the custom GUI for.

label

The label of this property.

Current material editor.