Summary
This method tries to retrieve a FlexMotionLayer playing the specified FlexMotion asset.
In the case if two layers with the same asset is playing (I.E. Self-transition), the layer in In or Active state will be prioritized.
If the layer is found, it will be assigned to the output parameter "motionLayer" and the method will return true.
If the layer is not found, "motionLayer" will be set to null and the method will return false.
The mask layer index parameter is optional and defaults to 0 if not specified.
Syntax
public bool TryGetLayer(object animationAsset, out FlexMotionLayer motionLayer, int maskLayerIndex = 0)
Parameters
| Name |
Type |
Description |
| animationAsset |
object |
The animation asset to search for. Typically an FlexMotion asset or an AnimationClip. |
| motionLayer |
FlexMotionLayer |
The FlexMotionLayer that is found (or null if not found). |
| maskLayerIndex |
int |
The mask layer index to search for (optional, default is 0). |
Return Value
| Type |
Description |
| bool |
True if the FlexMotionLayer is found, false otherwise. |