Version: 2023.2

TerrainPaintToolWithOverlaysBase

class in UnityEditor.TerrainTools

/

继承自:EditorTools.EditorTool

切换到手册

描述

The abstract class that TerrainPaintToolWithOverlays inherits from.

Contains fields that can be overridden when you implement your own terrain painting tools to display in Terrain overlays. When you create custom Terrain Tools, they must inherit from the TerrainPaintToolWithOverlays<T0> class rather than this class.

变量

CategoryThe TerrainCategory that the Terrain Tool belongs to.
HasBrushAttributesTrue if the Terrain Tool has brush attributes, false otherwise.
HasBrushMaskTrue if Terrain Tool has brush masks, false otherwise.
HasToolSettingsTrue if Terrain Tool has custom settings, false otherwise.
IconIndexThe index at which you should place the Terrain Tool in the Terrain Tools overlay.
OffIconThe icon displayed in the Terrain Tools overlay when the Terrain Tool isn't selected.
OnIconThe icon displayed in the Terrain Tools overlay when the terrain tool is selected.
TerrainThe last hit terrain or the last active instance of a terrain object.

公共函数

GetDescriptionDescription of the Terrain Tool.
GetNameName of the Terrain Tool.
OnActivatedThis function is called when the tool is activated.
OnDisable在销毁工具时调用。
OnEnable在创建工具时调用。
OnEnterToolModeThis function is called when the Terrain Tool is activated.
OnExitToolModeThis function is called when the Terrain Tool becomes inactive.
OnInspectorGUICustom Terrain Tool OnInspectorGUI callback.
OnPaintCustom Terrain Tool paint callback.
OnRenderBrushPreviewUse this method to implement custom tool preview and UI behavior that only renders while the mouse is within the SceneView bounds or while you're actively using this tool.
OnSceneGUICustom Terrain Tool OnSceneGUI callback.
OnToolGUIThis method is used to implement the custom terrain editor paint tool.
OnToolSettingsGUIContains the IMGUI code for custom settings beyond the common settings.
OnWillBeDeactivatedInvoked before the terrain paint tool with overlays stops being the active tool.

继承的成员

变量

gridSnapEnabledUse this property to allow the current EditorTool to enable/disable grid snapping.
target所检查的对象。
targets正在检查的对象的数组。
toolbarIcon用于自定义编辑器工具的图标和工具提示。如果此函数未实现,工具栏将显示用于目标类型的 Inspector 图标。如果未定义目标类型,工具栏将显示 Tool Mode 图标。
hideFlags该对象应该隐藏、随场景一起保存还是由用户修改?
name对象的名称。

公共函数

IsAvailable根据编辑器状态检查自定义编辑器工具是否可用。
PopulateMenuAdds menu items to Scene view context menu.
GetInstanceIDGets the instance ID of the object.
ToString返回对象的名称。

静态函数

Destroy移除 GameObject、组件或资源。
DestroyImmediate立即销毁对象 /obj/。强烈建议您改用 Destroy。
DontDestroyOnLoad在加载新的 Scene 时,请勿销毁 Object。
FindAnyObjectByTypeRetrieves any active loaded object of Type type.
FindFirstObjectByTypeRetrieves the first active loaded object of Type type.
FindObjectsByTypeRetrieves a list of all loaded objects of Type type.
Instantiate克隆 original 对象并返回克隆对象。
CreateInstance创建脚本化对象的实例。

运算符

bool该对象是否存在?
operator !=比较两个对象是否引用不同的对象。
operator ==比较两个对象引用,判断它们是否引用同一个对象。

消息

Awake当 ScriptableObject 脚本启动时调用此函数。
OnDestroy当脚本化对象将销毁时调用此函数。
OnValidateEditor-only function that Unity calls when the script is loaded or a value changes in the Inspector.
Reset重置为默认值。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961