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

public class AIHandControllerDebugger : MonoBehaviour 
{
	public bool[] fingersOut = new bool[5];
	public Vector3 normal, indexDirection;

	[ContextMenu("Set fingers out")]
	private void SetFingersOut()
	{
		GetComponent<AIHandController>().SetFingersOut(fingersOut);
	}

	[ContextMenu("Set normal")]
	private void SetNormal()
	{
		GetComponent<AIHandController>().SetNormal(normal, indexDirection);
	}

	[ContextMenu("Test gestures")]
	private void TesteGestures()
	{
		StartCoroutine(TestGesturesCoroutine());
	}

	private IEnumerator TestGesturesCoroutine()
	{
		GestureManager.InitializeArray();
		AIHandController aiHandController = GetComponent<AIHandController>();
		
		for (int i = 0; i < GestureManager.gestures.Length; i++)
		{
			Debug.Log("testing gesture: " + GestureManager.gestures[i].gestureName);
			aiHandController.SetFingersOut(GestureManager.gestures[i].fingersOut);
			aiHandController.SetNormal(GestureManager.gestures[i].palmNormal, GestureManager.gestures[i].indexDirection);
			yield return new WaitForSeconds(0.8f);
			//Debug.Break();
		}		
	}
}