docs.unity.cn
    Show / Hide Table of Contents

    Class GraphicEditor

    Editor class used to edit UI Graphics. Extend this class to write your own graphic editor.

    Inheritance
    Object
    Object
    ScriptableObject
    Editor
    GraphicEditor
    ImageEditor
    RawImageEditor
    TextEditor
    Inherited Members
    Editor.CreateEditorWithContext(Object[], Object, Type)
    Editor.CreateEditorWithContext(Object[], Object)
    Editor.CreateCachedEditorWithContext(Object, Object, Type, Editor)
    Editor.CreateCachedEditorWithContext(Object[], Object, Type, Editor)
    Editor.CreateCachedEditor(Object, Type, Editor)
    Editor.CreateCachedEditor(Object[], Type, Editor)
    Editor.CreateEditor(Object)
    Editor.CreateEditor(Object, Type)
    Editor.CreateEditor(Object[])
    Editor.CreateEditor(Object[], Type)
    Editor.DrawPropertiesExcluding(SerializedObject, String[])
    Editor.DrawDefaultInspector()
    Editor.Repaint()
    Editor.CreateInspectorGUI()
    Editor.RequiresConstantRepaint()
    Editor.DrawHeader()
    Editor.OnHeaderGUI()
    Editor.ShouldHideOpenButton()
    Editor.DrawFoldoutInspector(Object, Editor)
    Editor.HasPreviewGUI()
    Editor.GetPreviewTitle()
    Editor.RenderStaticPreview(String, Object[], Int32, Int32)
    Editor.OnPreviewGUI(Rect, GUIStyle)
    Editor.OnInteractivePreviewGUI(Rect, GUIStyle)
    Editor.OnPreviewSettings()
    Editor.GetInfoString()
    Editor.DrawPreview(Rect)
    Editor.ReloadPreviewInstances()
    Editor.UseDefaultMargins()
    UnityEditor.Editor.MoveNextTarget()
    Editor.ResetTarget()
    Editor.target
    Editor.targets
    Editor.serializedObject
    Editor.finishedDefaultHeaderGUI
    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.FindObjectsOfType(Type, Boolean)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
    UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
    UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
    UnityEngine.Object.FindFirstObjectByType<T>()
    UnityEngine.Object.FindAnyObjectByType<T>()
    UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
    UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, Boolean)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: UnityEditor.UI
    Syntax
    [CustomEditor(typeof(MaskableGraphic), false)]
    [CanEditMultipleObjects]
    public class GraphicEditor : Editor, IPreviewable, IToolModeOwner

    Fields

    m_Color

    Declaration
    protected SerializedProperty m_Color
    Field Value
    Type Description
    SerializedProperty

    m_Maskable

    Declaration
    protected SerializedProperty m_Maskable
    Field Value
    Type Description
    SerializedProperty

    m_Material

    Declaration
    protected SerializedProperty m_Material
    Field Value
    Type Description
    SerializedProperty

    m_RaycastPadding

    Declaration
    protected SerializedProperty m_RaycastPadding
    Field Value
    Type Description
    SerializedProperty

    m_RaycastTarget

    Declaration
    protected SerializedProperty m_RaycastTarget
    Field Value
    Type Description
    SerializedProperty

    m_Script

    Declaration
    protected SerializedProperty m_Script
    Field Value
    Type Description
    SerializedProperty

    m_ShowNativeSize

    Declaration
    protected AnimBool m_ShowNativeSize
    Field Value
    Type Description
    AnimBool

    Methods

    AppearanceControlsGUI()

    GUI related to the appearance of the Graphic. Color and Material properties appear here.

    Declaration
    protected void AppearanceControlsGUI()

    MaskableControlsGUI()

    Declaration
    protected void MaskableControlsGUI()

    NativeSizeButtonGUI()

    GUI for showing a button that sets the size of the RectTransform to the native size for this Graphic.

    Declaration
    protected void NativeSizeButtonGUI()

    OnDisable()

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    Declaration
    protected virtual void OnEnable()

    OnInspectorGUI()

    Declaration
    public override void OnInspectorGUI()
    Overrides
    Editor.OnInspectorGUI()

    RaycastControlsGUI()

    GUI related to the Raycasting settings for the graphic.

    Declaration
    protected void RaycastControlsGUI()

    SetShowNativeSize(Boolean, Boolean)

    Set if the 'Set Native Size' button should be visible for this editor.

    Declaration
    protected void SetShowNativeSize(bool show, bool instant)
    Parameters
    Type Name Description
    Boolean show

    Are we showing or hiding the AnimBool for the size.

    Boolean instant

    Should the size AnimBool change instantly.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023