using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HipBehaviour : MonoBehaviour {
    public KeyCode Rtrigger;
    public KeyCode Ltrigger;
    Animator m_Animator;


    bool left;
    bool right;

    public string rightStr;
    public string leftStr;


    // Use this for initialization
    void Start () {
        GameObject player = GameObject.Find("Main");

        m_Animator = player.gameObject.GetComponent<Animator>();

    }

    // Update is called once per frame
    void Update () {
        if (Input.GetKeyDown(Rtrigger)/* && not in the middle of an animation*/)
        {
            right =  right ? false : true;

        }


        if (Input.GetKeyDown(Ltrigger)/* && not in the middle of an animation*/)
        {
            left = left ? false : true;


        }
        m_Animator.SetBool(rightStr, right);
        m_Animator.SetBool(leftStr, left);


    }
}
