//============================================================================================ /** * @brief * *********************************************************************************************/ public int SetLayer(int a_layerId, AnimationClip a_clip, float a_weight = 0f, bool a_additive = false, AvatarMask a_mask = null) { if (a_clip == null) { Debug.LogError("Attempting to set a layer with a null AnimationClip.... action aborted."); return(-1); } MxMLayer layer = null; if (m_layers.TryGetValue(a_layerId, out layer)) { layer.SetLayerClip(a_clip); layer.Mask = a_mask; m_animationLayerMixer.SetInputWeight(a_layerId, a_weight); m_animationLayerMixer.SetLayerAdditive((uint)a_layerId, a_additive); return(a_layerId); } else { Debug.LogError("Could not set layer. Layer does not exist."); return(-1); } }
//============================================================================================ /** * @brief * *********************************************************************************************/ public void SetLayerClip(int a_layerId, AnimationClip a_clip) { if (a_layerId > 1) { MxMLayer layer = null; if (m_layers.TryGetValue(a_layerId, out layer)) { layer.SetLayerClip(a_clip); layer.PrimaryClipTime = 0f; } } }
//============================================================================================ /** * @brief * *********************************************************************************************/ public void SetLayerClip(int a_layerId, AnimationClip a_clip, AvatarMask a_mask, float a_time = 0f, float a_weight = 1f) { if (a_layerId > 1) { MxMLayer layer = null; if (m_layers.TryGetValue(a_layerId, out layer)) { layer.SetLayerClip(a_clip, a_time); layer.Mask = a_mask; layer.Weight = a_weight; } } }