private void DrawLipsyncSwitch(AnimationClip element) { var isRegisteredAsLipsync = _editorEffector.MutableLimitedLipsync().Exists(animation => animation.clip == element); if (isRegisteredAsLipsync) { var col = GUI.color; try { GUI.color = new Color(0.44f, 0.65f, 1f); GUI.Box(new Rect(0, 0, CgeLayoutCommon.GuiSquareWidth, CgeLayoutCommon.GuiSquareHeight), ""); } finally { GUI.color = col; } } GUILayout.BeginArea(new Rect((CgeLayoutCommon.GuiSquareWidth - CgeLayoutCommon.PictureWidth) / 2, 0, CgeLayoutCommon.PictureWidth, CgeLayoutCommon.PictureHeight)); _common.DrawPreviewOrRefreshButton(element); GUILayout.EndArea(); GUILayout.Space(CgeLayoutCommon.PictureHeight); EditorGUI.BeginDisabledGroup(true); EditorGUILayout.ObjectField(element, typeof(AnimationClip), true); EditorGUI.EndDisabledGroup(); if (GUILayout.Button(isRegisteredAsLipsync ? "Limited Lipsync" : "")) { if (isRegisteredAsLipsync) { _editorEffector.MutableLimitedLipsync().RemoveAll(animation => animation.clip == element); } else { _editorEffector.MutableLimitedLipsync().Add(new ComboGestureActivity.LimitedLipsyncAnimation { clip = element, limitation = ComboGestureActivity.LipsyncLimitation.WideOpenMouth }); } } }