Tanoda
Leap.Unity.GraphicalRenderer.LeapGraphic Class Reference
Inheritance diagram for Leap.Unity.GraphicalRenderer.LeapGraphic:
Leap.Unity.Space.ISpaceComponent Leap.Unity.GraphicalRenderer.LeapMeshGraphicBase Leap.Unity.GraphicalRenderer.LeapMeshGraphicBase Leap.Unity.GraphicalRenderer.LeapTextGraphic Leap.Unity.GraphicalRenderer.LeapMeshGraphic Leap.Unity.GraphicalRenderer.LeapSlicedGraphic Leap.Unity.GraphicalRenderer.LeapSpriteGraphic Leap.Unity.GraphicalRenderer.LeapMeshGraphic Leap.Unity.GraphicalRenderer.LeapSlicedGraphic Leap.Unity.GraphicalRenderer.LeapSpriteGraphic Leap.Unity.GraphicalRenderer.LeapBoxGraphic Leap.Unity.GraphicalRenderer.LeapPanelGraphic Leap.Unity.GraphicalRenderer.LeapPanelOutlineGraphic Leap.Unity.GraphicalRenderer.LeapBoxGraphic Leap.Unity.GraphicalRenderer.LeapPanelGraphic Leap.Unity.GraphicalRenderer.LeapPanelOutlineGraphic

Classes

class  FeatureDataList
 

Public Member Functions

void SetBlendShapeAmount (float amount)
 Helper method to set the blend shape amount for a blend shape data object attached to this graphic. This method will throw an exception if there is no blend shape data obj attached to this graphic. More...
 
float GetBlendShapeAmount ()
 Helper method to get the blend shape amount for a blend shape data object attached to this graphic. This method will throw an exception if there is no blend shape data obj attached to this graphic. More...
 
void SetCustomChannel (string channelName, Color color)
 Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type. More...
 
void SetCustomChannel (string channelName, float value)
 Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type. More...
 
void SetCustomChannel (string channelName, Matrix4x4 value)
 Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type. More...
 
void SetCustomChannel (string channelName, Vector4 value)
 Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type. More...
 
GetCustomChannel< T > (string channelName)
 Helper method to get a custom channel data object given the name of the feature it is attached to. This method can only be used if the graphic is currently attached to a group. More...
 
void SetRuntimeTint (Color color)
 Helper method to set the runtime tint color for a runtime tint data object attached to this graphic. This method will throw an exception if there is no tint data obj attached to this graphic. More...
 
void SetRuntimeTint (string htmlString)
 Overload of SetRuntimeTint that takes in a Html style string code that represents a color. Any string that can be parsed by ColorUtility.TryParseHtmlString can be used as an argument to this method. More...
 
Color GetRuntimeTint ()
 Helper method to get the runtime tint color for a runtime tint data object attached to this graphic. This method will throw an exception if there is no tint data obj attached to this graphic. More...
 
bool TryDetach ()
 This method tries to detach this graphic from whatever group it is currently attached to. It can fail if the graphic is not attached to any group, or if the group it is attached to does not support adding/removing graphics at runtime. More...
 
GetFeatureData< T > ()
 Gets a single feature data object of a given type T. This will return null if there is no feature data object attached to this graphic of type T. More...
 
virtual void NotifyWillBeAttached (LeapGraphicGroup toBeAttachedTo)
 Called by the system to notify that this graphic will be attached within the next frame. This is only called at runtime. More...
 
virtual void CancelWillBeAttached ()
 Called by the system to notify that a previous notification that this graphic would be attached has been cancelled due to a call to TryRemoveGraphic. More...
 
virtual void NotifyWillBeDetached (LeapGraphicGroup toBeDetachedFrom)
 Called by the system to notify that this graphic will be detached within the next frame. This is only called at runtime. More...
 
virtual void CancelWillBeDetached ()
 Called by the system to notify that a previous notification that this graphic would be detached has been cancelled due to a call to TryAddGraphic. More...
 
virtual void OnAttachedToGroup (LeapGraphicGroup group, LeapSpaceAnchor anchor)
 Called by the system when this graphic is attached to a group. This method is invoked both at runtime and at edit time. More...
 
void OnUpdateAnchor (LeapSpaceAnchor anchor)
 Called by graphic groups when a renderer's attached space changes. More...
 
virtual void OnDetachedFromGroup ()
 Called by the system when this graphic is detached from a group. This method is invoked both at runtime and at edit time. More...
 
virtual void OnAssignFeatureData (List< LeapFeatureData > data)
 Called by the system whenever feature data is re-assigned to this graphic. This is only called at edit time. More...
 
virtual void OnBeforeSerialize ()
 
virtual void OnAfterDeserialize ()
 

Public Attributes

Action< LeapGraphicGroupOnAttachedToGroupEvent
 
Action OnDetachedFromGroupEvent
 

Protected Member Functions

virtual void Reset ()
 
virtual void OnValidate ()
 
virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDestroy ()
 
virtual void OnDrawGizmos ()
 

Protected Attributes

LeapSpaceAnchor _anchor
 
FeatureDataList _featureData = new FeatureDataList()
 
LeapGraphicRenderer _attachedRenderer
 
int _attachedGroupIndex = -1
 
string _favoriteGroupName
 
SerializableType _preferredRendererType
 

Properties

bool isRepresentationDirty [get, set]
 An internal flag that returns true if the visual representation of this graphic needs to be updated. You can set this to true to request a regeneration of the graphic during the next update cycle of the renderer. Note however, that not all renderers support updating the representation at runtime. More...
 
bool isRepresentationDirtyOrEditTime [get]
 A simple utility getter that returns true if isRepresentationDirty is true, OR it is currently edit time. More...
 
string favoriteGroupName [get, set]
 Gets or sets the name of the group that this graphic likes to be attached to. Whenever a graphic is enabled, it will try to attach to its favorite group. Whenever a graphic gets attached to a group, that group becomes its new favorite. More...
 
LeapSpaceAnchor anchor [get]
 Returns the space anchor for this graphic. This will be null if the graphic is not currently part of a space. The anchor cannot be changed dynamically at runtime. More...
 
ITransformer transformer [get]
 A utility getter that returns a transformer for this graphic. Even if the space anchor for this graphic is null, this will still return a valid transformer. In the null case, the transformer is always the identity transformer. More...
 
IList< LeapFeatureDatafeatureData [get]
 Returns a list of feature data attached to this graphic. If this graphic is attached to a group, this feature data matches 1-to-1 with the features attached to this group. More...
 
LeapGraphicGroup attachedGroup [get]
 Returns the group this graphic is attached to. More...
 
bool isAttachedToGroup [get]
 Returns whether or not this graphic is attached to any group. Can still return false at runtime even if TryAddGraphic has just completed successfully due to the runtime delay for addition/removal of graphics. More...
 
bool willbeAttached [get]
 Returns whether or not this graphic will be attached to a group within the next frame. Can only be true at runtime, since runtime is the only time when delayed attachment occurs. More...
 
bool willbeDetached [get]
 Returns whether or not this graphic will be detached from a group within the next frame. Can only be true at runtime, since runtime is the only time when delayed detaching occurs. More...
 
Type preferredRendererType [get]
 Returns the type this graphic prefers to be attached to. When calling LeapGraphicRenderer.TryAddGraphic it will prioritize being attached to groups with this renderer type if possible. More...
 
- Properties inherited from Leap.Unity.Space.ISpaceComponent
LeapSpaceAnchor anchor [get]
 

Detailed Description

Definition at line 14 of file LeapGraphicEditorApi.cs.

Member Function Documentation

◆ Awake()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.Awake ( )
protectedvirtual

Definition at line 353 of file LeapGraphic.cs.

◆ CancelWillBeAttached()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.CancelWillBeAttached ( )
virtual

Called by the system to notify that a previous notification that this graphic would be attached has been cancelled due to a call to TryRemoveGraphic.

Definition at line 240 of file LeapGraphic.cs.

◆ CancelWillBeDetached()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.CancelWillBeDetached ( )
virtual

Called by the system to notify that a previous notification that this graphic would be detached has been cancelled due to a call to TryAddGraphic.

Definition at line 262 of file LeapGraphic.cs.

◆ GetBlendShapeAmount()

float Leap.Unity.GraphicalRenderer.LeapGraphic.GetBlendShapeAmount ( )

Helper method to get the blend shape amount for a blend shape data object attached to this graphic. This method will throw an exception if there is no blend shape data obj attached to this graphic.

Definition at line 35 of file LeapBlendShapeData.cs.

◆ GetCustomChannel< T >()

T Leap.Unity.GraphicalRenderer.LeapGraphic.GetCustomChannel< T > ( string  channelName)

Helper method to get a custom channel data object given the name of the feature it is attached to. This method can only be used if the graphic is currently attached to a group.

Type Constraints
T :CustomChannelDataBase 

Definition at line 21 of file CustomChannelDataBase.cs.

◆ GetFeatureData< T >()

T Leap.Unity.GraphicalRenderer.LeapGraphic.GetFeatureData< T > ( )

Gets a single feature data object of a given type T. This will return null if there is no feature data object attached to this graphic of type T.

>

Type Constraints
T :LeapFeatureData 

Definition at line 220 of file LeapGraphic.cs.

◆ GetRuntimeTint()

Color Leap.Unity.GraphicalRenderer.LeapGraphic.GetRuntimeTint ( )

Helper method to get the runtime tint color for a runtime tint data object attached to this graphic. This method will throw an exception if there is no tint data obj attached to this graphic.

Definition at line 42 of file LeapRuntimeTintData.cs.

◆ NotifyWillBeAttached()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.NotifyWillBeAttached ( LeapGraphicGroup  toBeAttachedTo)
virtual

Called by the system to notify that this graphic will be attached within the next frame. This is only called at runtime.

Definition at line 228 of file LeapGraphic.cs.

◆ NotifyWillBeDetached()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.NotifyWillBeDetached ( LeapGraphicGroup  toBeDetachedFrom)
virtual

Called by the system to notify that this graphic will be detached within the next frame. This is only called at runtime.

Definition at line 252 of file LeapGraphic.cs.

◆ OnAfterDeserialize()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnAfterDeserialize ( )
virtual

Definition at line 396 of file LeapGraphic.cs.

◆ OnAssignFeatureData()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnAssignFeatureData ( List< LeapFeatureData data)
virtual

Called by the system whenever feature data is re-assigned to this graphic. This is only called at edit time.

Definition at line 323 of file LeapGraphic.cs.

◆ OnAttachedToGroup()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnAttachedToGroup ( LeapGraphicGroup  group,
LeapSpaceAnchor  anchor 
)
virtual

Called by the system when this graphic is attached to a group. This method is invoked both at runtime and at edit time.

Definition at line 272 of file LeapGraphic.cs.

◆ OnBeforeSerialize()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnBeforeSerialize ( )
virtual

Definition at line 394 of file LeapGraphic.cs.

◆ OnDestroy()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnDestroy ( )
protectedvirtual

Definition at line 368 of file LeapGraphic.cs.

◆ OnDetachedFromGroup()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnDetachedFromGroup ( )
virtual

Called by the system when this graphic is detached from a group. This method is invoked both at runtime and at edit time.

Definition at line 303 of file LeapGraphic.cs.

◆ OnDrawGizmos()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnDrawGizmos ( )
protectedvirtual

Definition at line 374 of file LeapGraphic.cs.

◆ OnEnable()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnEnable ( )
protectedvirtual

Definition at line 364 of file LeapGraphic.cs.

◆ OnUpdateAnchor()

void Leap.Unity.GraphicalRenderer.LeapGraphic.OnUpdateAnchor ( LeapSpaceAnchor  anchor)

Called by graphic groups when a renderer's attached space changes.

Definition at line 295 of file LeapGraphic.cs.

◆ OnValidate()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.OnValidate ( )
protectedvirtual

◆ Reset()

virtual void Leap.Unity.GraphicalRenderer.LeapGraphic.Reset ( )
protectedvirtual

Reimplemented in Leap.Unity.GraphicalRenderer.LeapSlicedGraphic.

Definition at line 332 of file LeapGraphic.cs.

◆ SetBlendShapeAmount()

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetBlendShapeAmount ( float  amount)

Helper method to set the blend shape amount for a blend shape data object attached to this graphic. This method will throw an exception if there is no blend shape data obj attached to this graphic.

Definition at line 25 of file LeapBlendShapeData.cs.

◆ SetCustomChannel() [1/4]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetCustomChannel ( string  channelName,
Color  color 
)

Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type.

Definition at line 22 of file CustomColorChannelData.cs.

◆ SetCustomChannel() [2/4]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetCustomChannel ( string  channelName,
float  value 
)

Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type.

Definition at line 21 of file CustomFloatChannelData.cs.

◆ SetCustomChannel() [3/4]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetCustomChannel ( string  channelName,
Matrix4x4  value 
)

Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type.

Definition at line 22 of file CustomMatrixChannelData.cs.

◆ SetCustomChannel() [4/4]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetCustomChannel ( string  channelName,
Vector4  value 
)

Helper method to set the custom channel value for the given channel name. This method will throw an exception if there is no channel with the given name, if the graphic is not currently attached to a group, or if the channel does not match up with the data type.

Definition at line 22 of file CustomVectorChannelData.cs.

◆ SetRuntimeTint() [1/2]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetRuntimeTint ( Color  color)

Helper method to set the runtime tint color for a runtime tint data object attached to this graphic. This method will throw an exception if there is no tint data obj attached to this graphic.

Definition at line 22 of file LeapRuntimeTintData.cs.

◆ SetRuntimeTint() [2/2]

void Leap.Unity.GraphicalRenderer.LeapGraphic.SetRuntimeTint ( string  htmlString)

Overload of SetRuntimeTint that takes in a Html style string code that represents a color. Any string that can be parsed by ColorUtility.TryParseHtmlString can be used as an argument to this method.

Definition at line 32 of file LeapRuntimeTintData.cs.

◆ TryDetach()

bool Leap.Unity.GraphicalRenderer.LeapGraphic.TryDetach ( )

This method tries to detach this graphic from whatever group it is currently attached to. It can fail if the graphic is not attached to any group, or if the group it is attached to does not support adding/removing graphics at runtime.

Definition at line 207 of file LeapGraphic.cs.

Member Data Documentation

◆ _anchor

LeapSpaceAnchor Leap.Unity.GraphicalRenderer.LeapGraphic._anchor
protected

Definition at line 25 of file LeapGraphic.cs.

◆ _attachedGroupIndex

int Leap.Unity.GraphicalRenderer.LeapGraphic._attachedGroupIndex = -1
protected

Definition at line 34 of file LeapGraphic.cs.

◆ _attachedRenderer

LeapGraphicRenderer Leap.Unity.GraphicalRenderer.LeapGraphic._attachedRenderer
protected

Definition at line 31 of file LeapGraphic.cs.

◆ _favoriteGroupName

string Leap.Unity.GraphicalRenderer.LeapGraphic._favoriteGroupName
protected

Definition at line 37 of file LeapGraphic.cs.

◆ _featureData

FeatureDataList Leap.Unity.GraphicalRenderer.LeapGraphic._featureData = new FeatureDataList()
protected

Definition at line 28 of file LeapGraphic.cs.

◆ _preferredRendererType

SerializableType Leap.Unity.GraphicalRenderer.LeapGraphic._preferredRendererType
protected

Definition at line 40 of file LeapGraphic.cs.

◆ OnAttachedToGroupEvent

Action<LeapGraphicGroup> Leap.Unity.GraphicalRenderer.LeapGraphic.OnAttachedToGroupEvent

Definition at line 54 of file LeapGraphic.cs.

◆ OnDetachedFromGroupEvent

Action Leap.Unity.GraphicalRenderer.LeapGraphic.OnDetachedFromGroupEvent

Definition at line 55 of file LeapGraphic.cs.

Property Documentation

◆ anchor

LeapSpaceAnchor Leap.Unity.GraphicalRenderer.LeapGraphic.anchor
get

Returns the space anchor for this graphic. This will be null if the graphic is not currently part of a space. The anchor cannot be changed dynamically at runtime.

Implements Leap.Unity.Space.ISpaceComponent.

Definition at line 108 of file LeapGraphic.cs.

◆ attachedGroup

LeapGraphicGroup Leap.Unity.GraphicalRenderer.LeapGraphic.attachedGroup
get

Returns the group this graphic is attached to.

Definition at line 140 of file LeapGraphic.cs.

◆ favoriteGroupName

string Leap.Unity.GraphicalRenderer.LeapGraphic.favoriteGroupName
getset

Gets or sets the name of the group that this graphic likes to be attached to. Whenever a graphic is enabled, it will try to attach to its favorite group. Whenever a graphic gets attached to a group, that group becomes its new favorite.

Definition at line 94 of file LeapGraphic.cs.

◆ featureData

IList<LeapFeatureData> Leap.Unity.GraphicalRenderer.LeapGraphic.featureData
get

Returns a list of feature data attached to this graphic. If this graphic is attached to a group, this feature data matches 1-to-1 with the features attached to this group.

Definition at line 131 of file LeapGraphic.cs.

◆ isAttachedToGroup

bool Leap.Unity.GraphicalRenderer.LeapGraphic.isAttachedToGroup
get

Returns whether or not this graphic is attached to any group. Can still return false at runtime even if TryAddGraphic has just completed successfully due to the runtime delay for addition/removal of graphics.

Definition at line 162 of file LeapGraphic.cs.

◆ isRepresentationDirty

bool Leap.Unity.GraphicalRenderer.LeapGraphic.isRepresentationDirty
getset

An internal flag that returns true if the visual representation of this graphic needs to be updated. You can set this to true to request a regeneration of the graphic during the next update cycle of the renderer. Note however, that not all renderers support updating the representation at runtime.

Definition at line 64 of file LeapGraphic.cs.

◆ isRepresentationDirtyOrEditTime

bool Leap.Unity.GraphicalRenderer.LeapGraphic.isRepresentationDirtyOrEditTime
get

A simple utility getter that returns true if isRepresentationDirty is true, OR it is currently edit time.

Definition at line 77 of file LeapGraphic.cs.

◆ preferredRendererType

Type Leap.Unity.GraphicalRenderer.LeapGraphic.preferredRendererType
get

Returns the type this graphic prefers to be attached to. When calling LeapGraphicRenderer.TryAddGraphic it will prioritize being attached to groups with this renderer type if possible.

Definition at line 195 of file LeapGraphic.cs.

◆ transformer

ITransformer Leap.Unity.GraphicalRenderer.LeapGraphic.transformer
get

A utility getter that returns a transformer for this graphic. Even if the space anchor for this graphic is null, this will still return a valid transformer. In the null case, the transformer is always the identity transformer.

Definition at line 120 of file LeapGraphic.cs.

◆ willbeAttached

bool Leap.Unity.GraphicalRenderer.LeapGraphic.willbeAttached
get

Returns whether or not this graphic will be attached to a group within the next frame. Can only be true at runtime, since runtime is the only time when delayed attachment occurs.

Definition at line 173 of file LeapGraphic.cs.

◆ willbeDetached

bool Leap.Unity.GraphicalRenderer.LeapGraphic.willbeDetached
get

Returns whether or not this graphic will be detached from a group within the next frame. Can only be true at runtime, since runtime is the only time when delayed detaching occurs.

Definition at line 184 of file LeapGraphic.cs.


The documentation for this class was generated from the following files: