Scripting API

Graphic

class in UnityEngine.UI · UnityEngine.UI · inherits from UIBehaviour

51 of 61 of Unity's members
In Tassix

Something a canvas draws: it builds a mesh (OnPopulateMesh, then any mesh effects) and a material when it's dirty, as the canvases update.

Properties 12

Canvas? canvas { get; }
CanvasRenderer canvasRenderer { get; }
virtual Color color { get; set; }
static Material defaultGraphicMaterial { get; }
virtual Material defaultMaterial { get; }
int depth { get; }
virtual Texture mainTexture { get; }
virtual Material material { get; set; }
virtual Material materialForRendering { get; }
Vector4 raycastPadding { get; set; }
virtual bool raycastTarget { get; set; }
RectTransform rectTransform { get; }

Methods 20

virtual void CrossFadeAlpha(float alpha, float duration, bool ignoreTimeScale)

Fades the canvas renderer's alpha to alpha (its color stays).

virtual void CrossFadeColor(Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
virtual void CrossFadeColor(Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha, bool useRGB)

Fades the canvas renderer's color (which tints the graphic's own) to the target over the duration; instantly when the duration is 0 or the graphic isn't active.

Rect GetPixelAdjustedRect()
virtual void GraphicUpdateComplete()
virtual void LayoutComplete()
virtual void OnCullingChanged()
Vector2 PixelAdjustPoint(Vector2 point)
virtual bool Raycast(Vector2 sp, Camera? eventCamera)

Whether a screen point hits this graphic (for raycasts).

virtual void Rebuild(CanvasUpdate update)
void RegisterDirtyLayoutCallback(UnityAction action)
void RegisterDirtyMaterialCallback(UnityAction action)
void RegisterDirtyVerticesCallback(UnityAction action)
virtual void SetAllDirty()
virtual void SetLayoutDirty()
virtual void SetMaterialDirty()
virtual void SetNativeSize()
virtual void SetVerticesDirty()
void UnregisterDirtyLayoutCallback(UnityAction action)
void UnregisterDirtyMaterialCallback(UnityAction action)
void UnregisterDirtyVerticesCallback(UnityAction action)

Not in Tassix yet 10

OnRebuildRequested OnValidate Reset SetRaycastDirty m_CachedMesh m_CachedUvs m_SkipLayoutUpdate m_SkipMaterialUpdate s_Mesh useLegacyMeshGeneration