void AddHandgestureToDictionary(string animationname, PICKERTYPE type, GameObject obj)
    {
        var dict = type == PICKERTYPE.LEFT ? leftHandGestureDictionary : rightHandGestureDictionary;

        if (animationname.Contains(FIST))
            dict[FIST].Add(obj);
        else if (animationname.Contains(FLAT))
            dict[FLAT].Add(obj);
        else if (animationname.Contains(TWOFINGER))
            dict[TWOFINGER].Add(obj);
        else if (animationname.Contains(ONEFINGER))
            dict[ONEFINGER].Add(obj);
        else if (animationname.Contains(FIVEFINGER))
            dict[FIVEFINGER].Add(obj);
    }
    private void CreateButton(RectTransform targetContent, string animationName, PICKERTYPE type)
    {
        GameObject button = Instantiate(buttonPrefab) as GameObject;
        button.name = "UI_Button_" + animationName;
        Text text = button.GetComponentInChildren<Text>();
        if (text)text.text = animationName;
        button.GetComponent<Button>().onClick.AddListener(delegate { OnPicked(animationName, type, button); });
        Image img = button.GetComponentsInChildren<Image>()[1];
        text.gameObject.SetActive(false);
        img.sprite = Resources.Load<Sprite>(animationName);

        if (type != PICKERTYPE.FACE)
        {
            button.SetActive(false);
            AddHandgestureToDictionary(animationName, type, button);
        }

        button.transform.SetParent(targetContent);
        button.transform.localScale = Vector3.one;
        button.transform.localEulerAngles = button.transform.position = Vector3.zero;
    }
    private void OnPicked(string animationName, PICKERTYPE type, GameObject sender)
    {
        switch (type)
        {
            case PICKERTYPE.LEFT:
                gestureController.SwitchGesture(animationName, GestureAnimationController.Hand.left);
                TimelineController.Instance.CurrentlySelectedElementInfo.sample.LeftHand.Gesture = gestureController.sGestures_L.IndexOf(animationName);
                if (lastPickedLeft) lastPickedLeft.interactable = true;
                lastPickedLeft = sender.GetComponent<Button>(); ;
                lastPickedLeft.interactable = false;
                break;
            case PICKERTYPE.FACE:
                gestureController.SwitchFaceExpression(animationName);
                TimelineController.Instance.CurrentlySelectedElementInfo.sample.FacialExpression = gestureController.sFaceExp.IndexOf(animationName);
                if (lastPickedFace) lastPickedFace.interactable = true;
                lastPickedFace = sender.GetComponent<Button>();
                lastPickedFace.interactable = false;

                break;
            case PICKERTYPE.RIGHT:
                gestureController.SwitchGesture(animationName, GestureAnimationController.Hand.right);
                TimelineController.Instance.CurrentlySelectedElementInfo.sample.RightHand.Gesture = gestureController.sGestures_R.IndexOf(animationName);
                if (lastPickedRight) lastPickedRight.interactable = true;
                lastPickedRight = sender.GetComponent<Button>();
                lastPickedRight.interactable = false;

                break;
            default:
                break;
        }
    }