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

public class KickMeter : MonoBehaviour
{
    public Kick kick;

    public float minRotation;
    public float maxRotation;

    public float angle;
    public RawImage arrowRawImage;

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Q))
        {
            angle = (kick.kickCharge - kick.minKickCharge) / (kick.maxKickCharge - kick.minKickCharge);
            angle *= (maxRotation + Mathf.Abs(minRotation));
            angle += minRotation;
            angle = Mathf.Clamp(angle, minRotation, maxRotation);

            arrowRawImage.rectTransform.rotation = Quaternion.Euler(0, 0, -angle);
        }
        else
        {
            arrowRawImage.rectTransform.rotation = Quaternion.Euler(0, 0, -minRotation);
        }





    }
}
