Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ButtonEditor

Namespace: UnityEditor.UI

/

Inherits from: UI.SelectableEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

Description

Custom Editor for the Button Component.

Extend this class to write a custom editor for an Button-derived component. See Also: Editor, CustomEditor.

Public Functions

OnInspectorGUISee Editor.OnInspectorGUI.

Inherited members

Variables

serializedObjectA SerializedObject representing the object or objects being inspected.
targetThe object being inspected.
targetsAn array of all the object being inspected.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public Functions

DrawDefaultInspectorDraw the built-in inspector.
DrawHeaderCall this function to draw the header of the editor.
DrawPreviewThe first entry point for Preview Drawing.
GetInfoStringImplement this method to show asset information on top of the asset preview.
GetPreviewTitleOverride this method if you want to change the label of the Preview area.
HasPreviewGUIOverride this method in subclasses if you implement OnPreviewGUI.
OnInteractivePreviewGUIImplement to create your own interactive custom preview. Interactive custom previews are used in the preview area of the inspector and the object selector.
OnPreviewGUIImplement to create your own custom preview for the preview area of the inspector, primary editor headers and the object selector.
OnPreviewSettingsOverride this method if you want to show custom controls in the preview header.
RenderStaticPreviewOverride this method if you want to render a static preview that shows.
RepaintRepaint any inspectors that shows this editor.
RequiresConstantRepaintDoes this edit require to be repainted constantly in its current state?
UseDefaultMarginsOverride this method in subclasses to return false if you don't want default margins.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

Static Functions

CreateCachedEditorOn return previousEditor is an editor for targetObject or targetObjects. The function either returns if the editor is already tracking the objects, or Destroys the previous editor and creates a new one.
CreateEditorMake a custom editor for targetObject or targetObjects.
DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.
CreateInstanceCreates an instance of a scriptable object with className.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares if two objects refer to the same.

Messages

OnSceneGUILets the Editor handle an event in the scene view.
OnDestroyThis function is called when the scriptable object will be destroyed.
OnDisableThis function is called when the scriptable object goes out of scope.
OnEnableThis function is called when the object is loaded.